From: Anders Carlsson Date: Tue, 8 Jul 2008 16:49:00 +0000 (+0000) Subject: Fix small bug. The evaluator now works well enough to pass all tests X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=559e56b3a201316ae0b7e7389879a8054f6a3a82;p=clang 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 --- 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!"); }