Avoid rollover with long
authorBrian Demsky <bdemsky@uci.edu>
Fri, 3 Jul 2020 03:44:25 +0000 (20:44 -0700)
committerBrian Demsky <bdemsky@uci.edu>
Fri, 3 Jul 2020 03:44:25 +0000 (20:44 -0700)
moreStatistics
src/main/gov/nasa/jpf/vm/ElementInfo.java
src/main/gov/nasa/jpf/vm/JPFOutputStream.java
src/main/gov/nasa/jpf/vm/serialize/CFSerializer.java

index 0b9af175098b2a6c9bc26578863fb4853d5e505f..329e40d12458266c523944f9ce8e77abd35b232f 100644 (file)
@@ -2,3 +2,7 @@
 ==> DEBUG: Number of conflicts   : 4
 ==> DEBUG: Number of transitions : 7
 
+==> DEBUG: State reduction mode  : true
+==> DEBUG: Number of conflicts   : 4
+==> DEBUG: Number of transitions : 7
+
index d853afb37a88585f77a4bfdf2ff43575562f70f7..c34e1c104977ea82eb09c0f474bc0e0a60856992 100644 (file)
@@ -137,7 +137,7 @@ public abstract class ElementInfo implements Cloneable {
 
   // cache for a serialized representation of the object, which can be used
   // by state-matching. Value interpretation depends on the configured Serializer
-  protected int sid;
+  protected long sid;
 
 
   // helpers for state storage/restore processing, to avoid explicit iterators on
@@ -259,11 +259,11 @@ public abstract class ElementInfo implements Cloneable {
   
   
   //--- sids are only supposed to be used by the Serializer
-  public void setSid(int id){
+  public void setSid(long id){
     sid = id;
   }
 
-  public int getSid() {
+  public long getSid() {
     return sid;
   }
 
index 71dfb9f7c076ea621de9e230bab1d79d1f8550c7..9b4fbbe15f72fdc6d78ab4d3b9ffbaedc76b75d5 100644 (file)
@@ -121,7 +121,7 @@ public class JPFOutputStream extends OutputStream {
     boolean isObject = ei.isObject();
     ClassInfo ci = ei.getClassInfo();
     
-    int ref = (useSid) ? ei.getSid() : ei.getObjectRef();
+    int ref = (useSid) ? ((int)ei.getSid()) : ei.getObjectRef();
     ps.printf("@%x ", ref);
     
     if (isObject){
index 7b5817761c9b354ffb94849914ac965f69e91efa..0f6eb0e0e77eee12a1e9551cb4f9f6ff32de3104 100644 (file)
@@ -55,8 +55,8 @@ public class CFSerializer extends FilteringSerializer {
   // over the serialized objects to reset their sids. This works by resetting
   // the sid to 0 upon backtrack, and counting either upwards from 1 or downwards
   // from -1, but store the absolute value in the serialization stream
-  int initsidCount=0;
-  int sidCount=1;
+  long initsidCount=0;
+  long sidCount=1;
 
   @Override
   protected void initReferenceQueue() {
@@ -83,7 +83,7 @@ public class CFSerializer extends FilteringSerializer {
         buf.add(0);
         return;
       }
-      int sid = ei.getSid();
+      long sid = ei.getSid();
       
       if (sid <= initsidCount){ // count sid upwards from 1
           sid = sidCount++;
@@ -92,7 +92,7 @@ public class CFSerializer extends FilteringSerializer {
       }
 
       // note that we always add the absolute sid value
-      buf.add(sid - initsidCount);
+      buf.add((int)(sid - initsidCount));
     }
   }
 
@@ -171,6 +171,6 @@ public class CFSerializer extends FilteringSerializer {
   
   @Override
   protected int getSerializedReferenceValue (ElementInfo ei){
-    return ei.getSid()-initsidCount;
+    return (int)(ei.getSid()-initsidCount);
   }
 }