aboutsummaryrefslogtreecommitdiff
path: root/lib/Checker/MallocChecker.cpp
diff options
context:
space:
mode:
authorJordy Rose <jediknil@belkadan.com>2010-08-18 04:33:47 +0000
committerJordy Rose <jediknil@belkadan.com>2010-08-18 04:33:47 +0000
commit9076014aa3750c8583490d9274a8f814642affaa (patch)
treef61a302d4fec3abbd704adda618d8766f20f53f2 /lib/Checker/MallocChecker.cpp
parent09cef09aae997931914684c6c467a53086becda2 (diff)
Remove dead malloc symbols from the symbol-state map.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111353 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Checker/MallocChecker.cpp')
-rw-r--r--lib/Checker/MallocChecker.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/Checker/MallocChecker.cpp b/lib/Checker/MallocChecker.cpp
index 7aa89e0998..0076e1e868 100644
--- a/lib/Checker/MallocChecker.cpp
+++ b/lib/Checker/MallocChecker.cpp
@@ -567,6 +567,7 @@ void MallocChecker::EvalDeadSymbols(CheckerContext &C,SymbolReaper &SymReaper) {
const GRState *state = C.getState();
RegionStateTy RS = state->get<RegionState>();
+ RegionStateTy::Factory &F = state->get_context<RegionState>();
for (RegionStateTy::iterator I = RS.begin(), E = RS.end(); I != E; ++I) {
if (SymReaper.isDead(I->first)) {
@@ -580,8 +581,14 @@ void MallocChecker::EvalDeadSymbols(CheckerContext &C,SymbolReaper &SymReaper) {
C.EmitReport(R);
}
}
+
+ // Remove the dead symbol from the map.
+ RS = F.Remove(RS, I->first);
}
}
+
+ state = state->set<RegionState>(RS);
+ C.GenerateNode(state);
}
void MallocChecker::EvalEndPath(GREndPathNodeBuilder &B, void *tag,