summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaExpr.cpp
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2009-09-17 06:31:27 +0000
committerDaniel Dunbar <daniel@zuster.org>2009-09-17 06:31:27 +0000
commit687fa86a3083a8895f156265d1750c6d8c29ddfb (patch)
tree87e18ed13d88847267b433a0aa458cda864f8ea8 /clang/lib/Sema/SemaExpr.cpp
parent4782a6ead5408cf55e086fd4f4e37558437f742d (diff)
downloadbcm5719-llvm-687fa86a3083a8895f156265d1750c6d8c29ddfb.tar.gz
bcm5719-llvm-687fa86a3083a8895f156265d1750c6d8c29ddfb.zip
Fix two crashes on value dependent expressions (shift and null-pointer check).
- Doug, please check. - PR4940. llvm-svn: 82129
Diffstat (limited to 'clang/lib/Sema/SemaExpr.cpp')
-rw-r--r--clang/lib/Sema/SemaExpr.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp
index 7b23486d5fd..70e137462f4 100644
--- a/clang/lib/Sema/SemaExpr.cpp
+++ b/clang/lib/Sema/SemaExpr.cpp
@@ -4339,7 +4339,8 @@ QualType Sema::CheckShiftOperands(Expr *&lex, Expr *&rex, SourceLocation Loc,
// Sanity-check shift operands
llvm::APSInt Right;
// Check right/shifter operand
- if (rex->isIntegerConstantExpr(Right, Context)) {
+ if (!rex->isValueDependent() &&
+ rex->isIntegerConstantExpr(Right, Context)) {
if (Right.isNegative())
Diag(Loc, diag::warn_shift_negative) << rex->getSourceRange();
else {
OpenPOWER on IntegriCloud