about summary refs log tree commit diff homepage
path: root/lib/Core
diff options
context:
space:
mode:
authorgladtbx <gladtbx@gmail.com>2017-03-01 15:53:54 -0600
committergladtbx <gladtbx@gmail.com>2017-03-01 15:55:44 -0600
commit923cf308465799038ce54da949a84906c45e8951 (patch)
treecdf48e224aefd73a0b38fd9d8c82cd7a9f32f8d7 /lib/Core
parent4f5ea494986689dd89f97f9a64082527557c71c9 (diff)
downloadklee-923cf308465799038ce54da949a84906c45e8951.tar.gz
fix for PathOS.id
Diffstat (limited to 'lib/Core')
-rw-r--r--lib/Core/Executor.cpp16
1 files changed, 10 insertions, 6 deletions
diff --git a/lib/Core/Executor.cpp b/lib/Core/Executor.cpp
index c5d294fb..f5b46fc0 100644
--- a/lib/Core/Executor.cpp
+++ b/lib/Core/Executor.cpp
@@ -976,14 +976,18 @@ Executor::fork(ExecutionState &current, ref<Expr> condition, bool isInternal) {
     falseState->ptreeNode = res.first;
     trueState->ptreeNode = res.second;
 
-    if (!isInternal) {
-      if (pathWriter) {
-        falseState->pathOS = pathWriter->open(current.pathOS);
+    if (pathWriter) {
+      // Need to update the pathOS.id field of falseState, otherwise the same id
+      // is used for both falseState and trueState.
+      falseState->pathOS = pathWriter->open(current.pathOS);
+      if (!isInternal) {
         trueState->pathOS << "1";
         falseState->pathOS << "0";
-      }      
-      if (symPathWriter) {
-        falseState->symPathOS = symPathWriter->open(current.symPathOS);
+      }
+    }
+    if (symPathWriter) {
+      falseState->symPathOS = symPathWriter->open(current.symPathOS);
+      if (!isInternal) {
         trueState->symPathOS << "1";
         falseState->symPathOS << "0";
       }