diff options
| author | Daniel Dunbar <daniel@zuster.org> | 2009-09-17 06:31:27 +0000 |
|---|---|---|
| committer | Daniel Dunbar <daniel@zuster.org> | 2009-09-17 06:31:27 +0000 |
| commit | 687fa86a3083a8895f156265d1750c6d8c29ddfb (patch) | |
| tree | 87e18ed13d88847267b433a0aa458cda864f8ea8 /clang/lib/AST/Expr.cpp | |
| parent | 4782a6ead5408cf55e086fd4f4e37558437f742d (diff) | |
| download | bcm5719-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/AST/Expr.cpp')
| -rw-r--r-- | clang/lib/AST/Expr.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/clang/lib/AST/Expr.cpp b/clang/lib/AST/Expr.cpp index 5682eb6dd55..d7565c7bbef 100644 --- a/clang/lib/AST/Expr.cpp +++ b/clang/lib/AST/Expr.cpp @@ -1626,6 +1626,9 @@ bool Expr::isIntegerConstantExpr(llvm::APSInt &Result, ASTContext &Ctx, /// integer constant expression with the value zero, or if this is one that is /// cast to void*. bool Expr::isNullPointerConstant(ASTContext &Ctx) const { + // Ignore value dependent expressions. + if (isValueDependent()) + return true; // Strip off a cast to void*, if it exists. Except in C++. if (const ExplicitCastExpr *CE = dyn_cast<ExplicitCastExpr>(this)) { if (!Ctx.getLangOptions().CPlusPlus) { |

