code changes
authorbdemsky <bdemsky>
Wed, 3 Nov 2010 10:35:16 +0000 (10:35 +0000)
committerbdemsky <bdemsky>
Wed, 3 Nov 2010 10:35:16 +0000 (10:35 +0000)
Robust/src/IR/Flat/RuntimeConflictResolver.java

index 8c856eb521ec33ac40a4944b567a76c3340ba9ca..aeaa40509dd694f342fae826729e2ec4b5b44424 100644 (file)
@@ -748,7 +748,7 @@ public class RuntimeConflictResolver {
       }
     }
 
-    int index=-1;
+    int index=0;
     if (taint.isRBlockTaint()) {
       FlatSESEEnterNode fsese=taint.getSESE();
       TempDescriptor tmp=taint.getVar();
@@ -756,6 +756,7 @@ public class RuntimeConflictResolver {
     }
 
     String strrcr=taint.isRBlockTaint()?"&record->rcrRecords["+index+"], ":"NULL, ";
+    String tasksrc=taint.isRBlockTaint()?"(SESEcommon *) record, ":"(SESEcommon *)(((INTPTR)record)&1LL), ";
     
     //Do call if we need it.
     if(primConfWrite||objConfWrite) {
@@ -765,9 +766,9 @@ public class RuntimeConflictResolver {
       int traverserID = doneTaints.get(taint);
         currCase.append("    int tmpkey"+depth+"=rcr_generateKey("+prefix+");\n");
       if (objConfRead)
-        currCase.append("    int tmpvar"+depth+"=rcr_WTWRITEBINCASE(allHashStructures["+heaprootNum+"], tmpkey"+depth+", (SESEcommon *) record, "+strrcr+index+");\n");
+        currCase.append("    int tmpvar"+depth+"=rcr_WTWRITEBINCASE(allHashStructures["+heaprootNum+"], tmpkey"+depth+", "+tasksrc+strrcr+index+");\n");
       else
-        currCase.append("    int tmpvar"+depth+"=rcr_WRITEBINCASE(allHashStructures["+heaprootNum+"], tmpkey"+depth+", (SESEcommon *) record, "+strrcr+index+");\n");
+        currCase.append("    int tmpvar"+depth+"=rcr_WRITEBINCASE(allHashStructures["+heaprootNum+"], tmpkey"+depth+", "+ tasksrc+strrcr+index+");\n");
     } else if (primConfRead||objConfRead) {
       int heaprootNum = connectedHRHash.get(taint).id;
       assert heaprootNum != -1;
@@ -775,9 +776,9 @@ public class RuntimeConflictResolver {
       int traverserID = doneTaints.get(taint);
       currCase.append("    int tmpkey"+depth+"=rcr_generateKey("+prefix+");\n");
       if (objConfRead) 
-        currCase.append("    int tmpvar"+depth+"=rcr_WTREADBINCASE(allHashStructures["+heaprootNum+"], tmpkey"+depth+", (SESEcommon *) record, "+strrcr+index+");\n");
+        currCase.append("    int tmpvar"+depth+"=rcr_WTREADBINCASE(allHashStructures["+heaprootNum+"], tmpkey"+depth+", "+tasksrc+strrcr+index+");\n");
       else
-        currCase.append("    int tmpvar"+depth+"=rcr_READBINCASE(allHashStructures["+heaprootNum+"], tmpkey"+depth+", (SESEcommon *) record, "+strrcr+index+");\n");
+        currCase.append("    int tmpvar"+depth+"=rcr_READBINCASE(allHashStructures["+heaprootNum+"], tmpkey"+depth+", "+tasksrc+strrcr+index+");\n");
     }
 
     if(primConfWrite||objConfWrite||primConfRead||objConfRead) {