diff options
author | Erich Keane <erich.keane@intel.com> | 2018-07-05 15:52:58 +0000 |
---|---|---|
committer | Erich Keane <erich.keane@intel.com> | 2018-07-05 15:52:58 +0000 |
commit | cb54964f808bd4383938948b0ebeb224d918d1bf (patch) | |
tree | 82fa0439232559e10c059bd128db50cba08dcafb /clang/lib/AST/ExprConstant.cpp | |
parent | 63e40087187f3ce8e05a6d19cd8d90cd4ecb5163 (diff) | |
download | bcm5719-llvm-cb54964f808bd4383938948b0ebeb224d918d1bf.tar.gz bcm5719-llvm-cb54964f808bd4383938948b0ebeb224d918d1bf.zip |
Fix __builtin_*_overflow when out-param isn't constexpr
As brought up on cfe-commits[1], r334650 causes the dependency of the
out parameter to the __builtin_*_overflow functions to be ignored. The result
was a usage that was otherwise constexpr (both operands to the operation were
constexpr) would be evaluated, but the out parameter wouldn't be modified, so
it would still be 'undef'.
This patch correctly handles the return value of handleAssignment to ensure that
this value is properly considered/evaluated.
[1] http://lists.llvm.org/pipermail/cfe-commits/Week-of-Mon-20180702/233667.html
llvm-svn: 336364
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 c700da635b7..828368a3e12 100644 --- a/clang/lib/AST/ExprConstant.cpp +++ b/clang/lib/AST/ExprConstant.cpp @@ -8346,7 +8346,8 @@ bool IntExprEvaluator::VisitBuiltinCallExpr(const CallExpr *E, } APValue APV{Result}; - handleAssignment(Info, E, ResultLValue, ResultType, APV); + if (!handleAssignment(Info, E, ResultLValue, ResultType, APV)) + return false; return Success(DidOverflow, E); } } |