summaryrefslogtreecommitdiffstats
path: root/clang/lib/StaticAnalyzer/Checkers
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2011-02-24 08:42:04 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2011-02-24 08:42:04 +0000
commit8f38c3843d16795daa5e3190bb002983c247fb87 (patch)
tree25047f7ff5a589a0aa86725fea91d24673229482 /clang/lib/StaticAnalyzer/Checkers
parent7bc01410439547f3d3dbe0632302451d93810e52 (diff)
downloadbcm5719-llvm-8f38c3843d16795daa5e3190bb002983c247fb87.tar.gz
bcm5719-llvm-8f38c3843d16795daa5e3190bb002983c247fb87.zip
[analyzer] Don't pass a GRState to CheckerManager::runCheckersForLocation, terrible mistake.
If the state is new, make sure an ExplodedNode is associated with it. llvm-svn: 126370
Diffstat (limited to 'clang/lib/StaticAnalyzer/Checkers')
-rw-r--r--clang/lib/StaticAnalyzer/Checkers/ExprEngine.cpp15
1 files changed, 11 insertions, 4 deletions
diff --git a/clang/lib/StaticAnalyzer/Checkers/ExprEngine.cpp b/clang/lib/StaticAnalyzer/Checkers/ExprEngine.cpp
index 7d020dacae4..c1b1e656989 100644
--- a/clang/lib/StaticAnalyzer/Checkers/ExprEngine.cpp
+++ b/clang/lib/StaticAnalyzer/Checkers/ExprEngine.cpp
@@ -1955,14 +1955,21 @@ void ExprEngine::evalLocation(ExplodedNodeSet &Dst, const Stmt *S,
return;
}
- ExplodedNodeSet Src;
- Src.Add(Pred);
if (Checkers.empty()) {
+ ExplodedNodeSet Src;
+ if (Builder->GetState(Pred) == state) {
+ Src.Add(Pred);
+ } else {
+ // Associate this new state with an ExplodedNode.
+ Src.Add(Builder->generateNode(S, state, Pred));
+ }
getCheckerManager().runCheckersForLocation(Dst, Src, location, isLoad, S,
- state, *this);
+ *this);
return;
}
+ ExplodedNodeSet Src;
+ Src.Add(Pred);
ExplodedNodeSet CheckersV1Dst;
ExplodedNodeSet Tmp;
ExplodedNodeSet *PrevSet = &Src;
@@ -1994,7 +2001,7 @@ void ExprEngine::evalLocation(ExplodedNodeSet &Dst, const Stmt *S,
}
getCheckerManager().runCheckersForLocation(Dst, CheckersV1Dst, location,
- isLoad, S, state, *this);
+ isLoad, S, *this);
}
bool ExprEngine::InlineCall(ExplodedNodeSet &Dst, const CallExpr *CE,
OpenPOWER on IntegriCloud