]> granicus.if.org Git - clang/commitdiff
fix isIntegerConstantExpr evaluation of unary !.
authorChris Lattner <sabre@nondot.org>
Fri, 25 Jan 2008 19:16:19 +0000 (19:16 +0000)
committerChris Lattner <sabre@nondot.org>
Fri, 25 Jan 2008 19:16:19 +0000 (19:16 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46364 91177308-0d34-0410-b5e6-96231b3b80d8

AST/Expr.cpp

index becce2a6222ace4f95e87a29d1d1fdfd58e223ad..51aa09c6baf0f1a0fd6a4e5bd4d91f06faccc8de 100644 (file)
@@ -703,7 +703,7 @@ bool Expr::isIntegerConstantExpr(llvm::APSInt &Result, ASTContext &Ctx,
       }
       break;
     case UnaryOperator::LNot: {
-      bool Val = Result != 0;
+      bool Val = Result == 0;
       Result.zextOrTrunc(
         static_cast<uint32_t>(Ctx.getTypeSize(getType(),
                                               Exp->getOperatorLoc())));