diff options
author | Anders Carlsson <andersca@mac.com> | 2008-07-08 16:49:00 +0000 |
---|---|---|
committer | Anders Carlsson <andersca@mac.com> | 2008-07-08 16:49:00 +0000 |
commit | 559e56b3a201316ae0b7e7389879a8054f6a3a82 (patch) | |
tree | 42fb71f232686ba2268fa471e434d19a74471683 /lib/AST/ExprConstant.cpp | |
parent | 650c92fdcc27a950a8a848ecab6a74e6f5e80788 (diff) |
Fix small bug. The evaluator now works well enough to pass all tests
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53238 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/ExprConstant.cpp')
-rw-r--r-- | lib/AST/ExprConstant.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/AST/ExprConstant.cpp b/lib/AST/ExprConstant.cpp index 860ff1c165..db2fc458a2 100644 --- a/lib/AST/ExprConstant.cpp +++ b/lib/AST/ExprConstant.cpp @@ -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!"); } |