From 687fa86a3083a8895f156265d1750c6d8c29ddfb Mon Sep 17 00:00:00 2001 From: Daniel Dunbar Date: Thu, 17 Sep 2009 06:31:27 +0000 Subject: Fix two crashes on value dependent expressions (shift and null-pointer check). - Doug, please check. - PR4940. llvm-svn: 82129 --- clang/lib/AST/Expr.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'clang/lib/AST/Expr.cpp') 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(this)) { if (!Ctx.getLangOptions().CPlusPlus) { -- cgit v1.2.3