]> granicus.if.org Git - clang/commitdiff
Fix small bug. The evaluator now works well enough to pass all tests
authorAnders Carlsson <andersca@mac.com>
Tue, 8 Jul 2008 16:49:00 +0000 (16:49 +0000)
committerAnders Carlsson <andersca@mac.com>
Tue, 8 Jul 2008 16:49:00 +0000 (16:49 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53238 91177308-0d34-0410-b5e6-96231b3b80d8

lib/AST/ExprConstant.cpp

index 860ff1c165be5847a51898e4b732deca36a01030..db2fc458a26210e0c05cc15a8f977de9d1a4a16f 100644 (file)
@@ -339,7 +339,8 @@ APValue IntExprEvaluator::HandleCast(const Expr* SubExpr, QualType DestType) {
     if (LV.getLValueBase())
       return APValue();
     
-    Result = llvm::APSInt(DestWidth, LV.getLValueOffset());
+    Result.extOrTrunc(DestWidth);
+    Result = LV.getLValueOffset();
   } else {
     assert(0 && "Unhandled cast!");
   }