about summary refs log tree commit diff homepage
path: root/lib/Core/MergeHandler.cpp
diff options
context:
space:
mode:
authorLukas Wölfer <lukas.woelfer@rwth-aachen.de>2018-05-30 16:00:21 +0200
committerMartinNowack <martin.nowack@gmail.com>2018-06-11 11:08:08 +0100
commitd4787aa0d8e41a886004ab195a49bfcfce30cede (patch)
treeead5e16219046c05879e0332ed75ccaaff17ce07 /lib/Core/MergeHandler.cpp
parent843e9be8fc10c6ffb30218c5a826aab192a31955 (diff)
downloadklee-d4787aa0d8e41a886004ab195a49bfcfce30cede.tar.gz
Fixed memory leak from Executor::inCloseMerge, fixes #883
Diffstat (limited to 'lib/Core/MergeHandler.cpp')
-rw-r--r--lib/Core/MergeHandler.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/Core/MergeHandler.cpp b/lib/Core/MergeHandler.cpp
index 67c24912..d3a6b59d 100644
--- a/lib/Core/MergeHandler.cpp
+++ b/lib/Core/MergeHandler.cpp
@@ -69,10 +69,6 @@ void MergeHandler::removeOpenState(ExecutionState *es){
   openStates.pop_back();
 }
 
-void MergeHandler::removeFromCloseMergeSet(ExecutionState *es){
-  executor->inCloseMerge.erase(es);
-}
-
 void MergeHandler::addClosedState(ExecutionState *es,
                                          llvm::Instruction *mp) {
   // Update stats
@@ -102,6 +98,7 @@ void MergeHandler::addClosedState(ExecutionState *es,
     for (auto& mState: cpv) {
       if (mState->merge(*es)) {
         executor->terminateState(*es);
+        executor->inCloseMerge.erase(es);
         mergedSuccessful = true;
         break;
       }
@@ -117,6 +114,7 @@ void MergeHandler::releaseStates() {
   for (auto& curMergeGroup: reachedCloseMerge) {
     for (auto curState: curMergeGroup.second) {
       executor->continueState(*curState);
+      executor->inCloseMerge.erase(curState);
     }
   }
   reachedCloseMerge.clear();