diff options
| author | Mike Stump <mrs@apple.com> | 2009-10-26 18:57:47 +0000 |
|---|---|---|
| committer | Mike Stump <mrs@apple.com> | 2009-10-26 18:57:47 +0000 |
| commit | 99f11f769e18b430cea73f6f40a43e0e098b3388 (patch) | |
| tree | b34875eebbc5a33b30d0cc4ff84367bab2e927a4 /clang/lib/AST | |
| parent | 0ae1b2961d44b95565e72018c61de9a4745d1a5e (diff) | |
| download | bcm5719-llvm-99f11f769e18b430cea73f6f40a43e0e098b3388.tar.gz bcm5719-llvm-99f11f769e18b430cea73f6f40a43e0e098b3388.zip | |
Be sure to zero-extend. And refactor.
llvm-svn: 85140
Diffstat (limited to 'clang/lib/AST')
| -rw-r--r-- | clang/lib/AST/ExprConstant.cpp | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/clang/lib/AST/ExprConstant.cpp b/clang/lib/AST/ExprConstant.cpp index 91295584214..f1a446ef6e7 100644 --- a/clang/lib/AST/ExprConstant.cpp +++ b/clang/lib/AST/ExprConstant.cpp @@ -875,11 +875,6 @@ bool IntExprEvaluator::VisitCallExpr(const CallExpr *E) { return Error(E->getLocStart(), diag::note_invalid_subexpr_in_ice, E); case Builtin::BI__builtin_object_size: { - llvm::APSInt Result(32); - - if (!E->getArg(1)->isIntegerConstantExpr(Result, Info.Ctx)) - assert(0 && "arg2 not ice in __builtin_object_size"); - const Expr *Arg = E->getArg(0)->IgnoreParens(); Expr::EvalResult Base; if (Arg->Evaluate(Base, Info.Ctx) @@ -895,7 +890,7 @@ bool IntExprEvaluator::VisitCallExpr(const CallExpr *E) { } if (Base.HasSideEffects) { - if (Result.getSExtValue() < 2) + if (E->getArg(1)->EvaluateAsInt(Info.Ctx).getZExtValue() < 2) return Success(-1, E); return Success(0, E); } |

