summaryrefslogtreecommitdiffstats
path: root/clang/lib/StaticAnalyzer/Core/ExprEngine.cpp
diff options
context:
space:
mode:
authorAnna Zaks <ganna@apple.com>2012-02-24 16:49:46 +0000
committerAnna Zaks <ganna@apple.com>2012-02-24 16:49:46 +0000
commit18de54b1a6d6b98bc764d5d63c40a70b6ec0bfea (patch)
treee8f56984bdf2692710bbd67bf01a57fd200aeb7b /clang/lib/StaticAnalyzer/Core/ExprEngine.cpp
parentcdf24a9a5e1df287bdb3a1e9144588990051cb8e (diff)
downloadbcm5719-llvm-18de54b1a6d6b98bc764d5d63c40a70b6ec0bfea.tar.gz
bcm5719-llvm-18de54b1a6d6b98bc764d5d63c40a70b6ec0bfea.zip
[analyzer] Run remove dead bindings before each call.
This ensures that we report the bugs associated with symbols going out of scope in the correct function context. llvm-svn: 151369
Diffstat (limited to 'clang/lib/StaticAnalyzer/Core/ExprEngine.cpp')
-rw-r--r--clang/lib/StaticAnalyzer/Core/ExprEngine.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/clang/lib/StaticAnalyzer/Core/ExprEngine.cpp b/clang/lib/StaticAnalyzer/Core/ExprEngine.cpp
index a61c0272b53..3cf07feadb6 100644
--- a/clang/lib/StaticAnalyzer/Core/ExprEngine.cpp
+++ b/clang/lib/StaticAnalyzer/Core/ExprEngine.cpp
@@ -230,7 +230,11 @@ static bool shouldRemoveDeadBindings(AnalysisManager &AMgr,
// Is this on a non-expression?
if (!isa<Expr>(S.getStmt()))
return true;
-
+
+ // Run before processing a call.
+ if (isa<CallExpr>(S.getStmt()))
+ return true;
+
// Is this an expression that is consumed by another expression? If so,
// postpone cleaning out the state.
ParentMap &PM = LC->getAnalysisDeclContext()->getParentMap();
OpenPOWER on IntegriCloud