[cfe-commits] r111353 - /cfe/trunk/lib/Checker/MallocChecker.cpp

Jordy Rose jediknil at belkadan.com
Tue Aug 17 21:33:47 PDT 2010


Author: jrose
Date: Tue Aug 17 23:33:47 2010
New Revision: 111353

URL: http://llvm.org/viewvc/llvm-project?rev=111353&view=rev
Log:
Remove dead malloc symbols from the symbol-state map.

Modified:
    cfe/trunk/lib/Checker/MallocChecker.cpp

Modified: cfe/trunk/lib/Checker/MallocChecker.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Checker/MallocChecker.cpp?rev=111353&r1=111352&r2=111353&view=diff
==============================================================================
--- cfe/trunk/lib/Checker/MallocChecker.cpp (original)
+++ cfe/trunk/lib/Checker/MallocChecker.cpp Tue Aug 17 23:33:47 2010
@@ -567,6 +567,7 @@
 
   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 @@
           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,





More information about the cfe-commits mailing list