summaryrefslogtreecommitdiffstats
path: root/clang/lib/StaticAnalyzer/Core/ExprEngineC.cpp
diff options
context:
space:
mode:
authorCsaba Dabis <dabis.csaba98@gmail.com>2019-06-25 00:44:33 +0000
committerCsaba Dabis <dabis.csaba98@gmail.com>2019-06-25 00:44:33 +0000
commit49885b1245c2678299e1e22c18add2511377b37e (patch)
tree7ef00df6bb7042f2af1361c7e53d0cfbcad3cd0a /clang/lib/StaticAnalyzer/Core/ExprEngineC.cpp
parent2cc3b3856e273662bc6d7cbc12edb1441a6de5b5 (diff)
downloadbcm5719-llvm-49885b1245c2678299e1e22c18add2511377b37e.tar.gz
bcm5719-llvm-49885b1245c2678299e1e22c18add2511377b37e.zip
[analyzer] ExprEngine: Escape pointers in bitwise operations
Summary: After evaluation it would be an Unknown value and tracking would be lost. Reviewers: NoQ, xazax.hun, ravikandhadai, baloghadamsoftware, Szelethus Reviewed By: NoQ Subscribers: szepet, rnkovacs, a.sidorin, mikhail.ramalho, donat.nagy, dkrupp, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D63720 llvm-svn: 364259
Diffstat (limited to 'clang/lib/StaticAnalyzer/Core/ExprEngineC.cpp')
-rw-r--r--clang/lib/StaticAnalyzer/Core/ExprEngineC.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/lib/StaticAnalyzer/Core/ExprEngineC.cpp b/clang/lib/StaticAnalyzer/Core/ExprEngineC.cpp
index cc62cf1048c..3b5a437e3c1 100644
--- a/clang/lib/StaticAnalyzer/Core/ExprEngineC.cpp
+++ b/clang/lib/StaticAnalyzer/Core/ExprEngineC.cpp
@@ -100,6 +100,10 @@ void ExprEngine::VisitBinaryOperator(const BinaryOperator* B,
SVal Result = evalBinOp(state, Op, LeftV, RightV, B->getType());
if (!Result.isUnknown()) {
state = state->BindExpr(B, LCtx, Result);
+ } else {
+ // If we cannot evaluate the operation escape the operands.
+ state = escapeValue(state, LeftV, PSK_EscapeOther);
+ state = escapeValue(state, RightV, PSK_EscapeOther);
}
Bldr.generateNode(B, *it, state);
OpenPOWER on IntegriCloud