aboutsummaryrefslogtreecommitdiff
path: root/lib/AST/ExprConstant.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/AST/ExprConstant.cpp')
-rw-r--r--lib/AST/ExprConstant.cpp3
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!");
}