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 | 01664814558343e4a305075e4155fc4ea7d499bd (patch) | |
tree | 5804ec4563a8b57959f3188f5d1843a887e3d666 /clang/lib/AST/ExprConstant.cpp | |
parent | 0a1e672dff50837e4cfd187098f6156d4187b22b (diff) | |
download | bcm5719-llvm-01664814558343e4a305075e4155fc4ea7d499bd.tar.gz bcm5719-llvm-01664814558343e4a305075e4155fc4ea7d499bd.zip |
Fix small bug. The evaluator now works well enough to pass all tests
llvm-svn: 53238
Diffstat (limited to 'clang/lib/AST/ExprConstant.cpp')
-rw-r--r-- | clang/lib/AST/ExprConstant.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/AST/ExprConstant.cpp b/clang/lib/AST/ExprConstant.cpp index 860ff1c165b..db2fc458a26 100644 --- a/clang/lib/AST/ExprConstant.cpp +++ b/clang/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!"); } |