diff options
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!"); } |