From 6d13ae6d567882ef73f18ecc9c58cdead7265320 Mon Sep 17 00:00:00 2001 From: bdemsky Date: Tue, 7 Apr 2009 05:06:39 +0000 Subject: [PATCH] fix loop bug --- Robust/src/ClassLibrary/Vector.java | 4 ++++ Robust/src/IR/Flat/BuildFlat.java | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) 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); -- 2.34.1