Fix small bug. The evaluator now works well enough to pass all tests

llvm-svn: 53238
This commit is contained in:
Anders Carlsson 2008-07-08 16:49:00 +00:00
parent 0a1e672dff
commit 0166481455
1 changed files with 2 additions and 1 deletions

View File

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