summaryrefslogtreecommitdiffstats
path: root/clang/lib/StaticAnalyzer/Core/ExprEngineC.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/ExprEngineC.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/ExprEngineC.cpp')
-rw-r--r--clang/lib/StaticAnalyzer/Core/ExprEngineC.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/clang/lib/StaticAnalyzer/Core/ExprEngineC.cpp b/clang/lib/StaticAnalyzer/Core/ExprEngineC.cpp
index fb13e89b5fa..7d47cf4f337 100644
--- a/clang/lib/StaticAnalyzer/Core/ExprEngineC.cpp
+++ b/clang/lib/StaticAnalyzer/Core/ExprEngineC.cpp
@@ -810,8 +810,9 @@ void ExprEngine::
VisitOffsetOfExpr(const OffsetOfExpr *OOE,
ExplodedNode *Pred, ExplodedNodeSet &Dst) {
StmtNodeBuilder B(Pred, Dst, *currBldrCtx);
- APSInt IV;
- if (OOE->EvaluateAsInt(IV, getContext())) {
+ Expr::EvalResult Result;
+ if (OOE->EvaluateAsInt(Result, getContext())) {
+ APSInt IV = Result.Val.getInt();
assert(IV.getBitWidth() == getContext().getTypeSize(OOE->getType()));
assert(OOE->getType()->isBuiltinType());
assert(OOE->getType()->getAs<BuiltinType>()->isInteger());
OpenPOWER on IntegriCloud