From: bdemsky Date: Tue, 7 Apr 2009 05:06:39 +0000 (+0000) Subject: fix loop bug X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=6d13ae6d567882ef73f18ecc9c58cdead7265320;p=IRC.git fix loop bug --- diff --git a/Robust/src/ClassLibrary/Vector.java b/Robust/src/ClassLibrary/Vector.java index 2b11ee23..cba46587 100644 --- a/Robust/src/ClassLibrary/Vector.java +++ b/Robust/src/ClassLibrary/Vector.java @@ -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]; diff --git a/Robust/src/IR/Flat/BuildFlat.java b/Robust/src/IR/Flat/BuildFlat.java index 307aa993..902db427 100644 --- a/Robust/src/IR/Flat/BuildFlat.java +++ b/Robust/src/IR/Flat/BuildFlat.java @@ -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);