Fix for a bug in finding the right integer values in the stack frame: need to find...
[jpf-core.git] / src / main / gov / nasa / jpf / listener / ConflictTracker.java
index 12eb14f22215095f3d635988d5d44c26a54959c2..9d2cd19f6e791d298d29dbc1276a2f6dd1bc2c11 100644 (file)
@@ -129,7 +129,7 @@ public class ConflictTracker extends ListenerAdapter {
           if (conflicts(u, u2)) {
             //throw new RuntimeException(createErrorMessage(u, u2));
             conflictFound = true;
-           errorMessage = createErrorMessage(u, u2);
+               errorMessage = createErrorMessage(u, u2);
           }
         }
       }
@@ -429,7 +429,7 @@ public class ConflictTracker extends ListenerAdapter {
     out.println("----------------------------------- search finished");
 
     //Comment out the following line to print the explored graph
-    // printGraph();
+    printGraph();
   }
 
   private String getValue(ThreadInfo ti, Instruction inst, byte type) {
@@ -446,7 +446,17 @@ public class ConflictTracker extends ListenerAdapter {
 
       lo = frame.peek();
       hi = frame.getTopPos() >= 1 ? frame.peek(1) : 0;
-       
+
+      // TODO: Fix for integer values (need to dig deeper into the stack frame to find the right value other than 0)
+      // TODO: Seems to be a problem since this is Groovy (not Java)
+      if (type == Types.T_INT || type == Types.T_LONG || type == Types.T_SHORT) {
+        int offset = 0;
+        while (lo == 0) {
+          lo = frame.peek(offset);
+          offset++;
+        }
+      }
+
       return(decodeValue(type, lo, hi));
     }