bug fix
authorbdemsky <bdemsky>
Wed, 8 Apr 2009 19:34:25 +0000 (19:34 +0000)
committerbdemsky <bdemsky>
Wed, 8 Apr 2009 19:34:25 +0000 (19:34 +0000)
Robust/src/Analysis/Locality/GenerateConversions.java

index 408ce3298e122345edb75146b5b4728e40a9fec8..4e9d3d673a05beb4688668bfa0519ee48c129d9a 100644 (file)
@@ -148,12 +148,16 @@ public class GenerateConversions {
          if (state.DSM)
            temptab.put(fgcn, (Hashtable<TempDescriptor, Integer>)temptab.get(fn).clone());
 
+         FlatNode[] prevarray=new FlatNode[fn.numPrev()];
          for(int i=0; i<fn.numPrev(); i++) {
            FlatNode fnprev=fn.getPrev(i);
-           for(int j=0; j<fnprev.numNext(); j++) {
-             if (fnprev.getNext(j)==fn) {
+           prevarray[i]=fnprev;
+         }
+         for(int i=0; i<prevarray.length; i++) {
+           for(int j=0; j<prevarray[i].numNext(); j++) {
+             if (prevarray[i].getNext(j)==fn) {
                //found index, change node
-               fnprev.setNext(j, fgcn);
+               prevarray[i].setNext(j, fgcn);
                break;
              }
            }