summaryrefslogtreecommitdiffstats
path: root/clang/lib/StaticAnalyzer/Core/SValBuilder.cpp
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2018-11-20 23:24:16 +0000
committerBill Wendling <isanbard@gmail.com>2018-11-20 23:24:16 +0000
commit91549ed15f97f21de8770196e66da3d228820cdc (patch)
treea4a3c5ffe121d9c0fdcce151e96eba612d3c7ded /clang/lib/StaticAnalyzer/Core/SValBuilder.cpp
parent8eb65cb25e67a2b426b94152f9c9bb3c1025b701 (diff)
downloadbcm5719-llvm-91549ed15f97f21de8770196e66da3d228820cdc.tar.gz
bcm5719-llvm-91549ed15f97f21de8770196e66da3d228820cdc.zip
Reinstate 347294 with a fix for the failures.
EvaluateAsInt() is sometimes called in a constant context. When that's the case, we need to specify it as so. llvm-svn: 347364
Diffstat (limited to 'clang/lib/StaticAnalyzer/Core/SValBuilder.cpp')
-rw-r--r--clang/lib/StaticAnalyzer/Core/SValBuilder.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/lib/StaticAnalyzer/Core/SValBuilder.cpp b/clang/lib/StaticAnalyzer/Core/SValBuilder.cpp
index ef3d5b76659..8c39b798946 100644
--- a/clang/lib/StaticAnalyzer/Core/SValBuilder.cpp
+++ b/clang/lib/StaticAnalyzer/Core/SValBuilder.cpp
@@ -362,9 +362,9 @@ Optional<SVal> SValBuilder::getConstantVal(const Expr *E) {
return None;
ASTContext &Ctx = getContext();
- llvm::APSInt Result;
+ Expr::EvalResult Result;
if (E->EvaluateAsInt(Result, Ctx))
- return makeIntVal(Result);
+ return makeIntVal(Result.Val.getInt());
if (Loc::isLocType(E->getType()))
if (E->isNullPointerConstant(Ctx, Expr::NPC_ValueDependentIsNotNull))
OpenPOWER on IntegriCloud