fix loop bug
authorbdemsky <bdemsky>
Tue, 7 Apr 2009 05:06:39 +0000 (05:06 +0000)
committerbdemsky <bdemsky>
Tue, 7 Apr 2009 05:06:39 +0000 (05:06 +0000)
Robust/src/ClassLibrary/Vector.java
Robust/src/IR/Flat/BuildFlat.java

index 2b11ee23db9d7f7f411515b105ed5de697bbd977..cba46587ccd90f8e2d0b8d230d7cc8b76afadcfe 100644 (file)
@@ -15,6 +15,10 @@ public class Vector {
     array=new Object[size];
   }
 
+  public boolean isEmpty() {
+    return size==0;
+  }
+
   public void clear() {
     size=0;
     array=new Object[10];
index 307aa993ab010bf5e556d3043355d2172450e3ac..902db427a073b8c212ef7e004dfd4e663023b1ce 100644 (file)
@@ -937,7 +937,8 @@ public class BuildFlat {
       FlatNop nopend=new FlatNop();
       FlatBackEdge backedge=new FlatBackEdge();
 
-      body.getEnd().addNext(backedge);
+      if (body.getEnd()!=null)
+       body.getEnd().addNext(backedge);
       backedge.addNext(condition.getBegin());
 
       condition.getEnd().addNext(fcb);