change
authorbdemsky <bdemsky>
Thu, 9 Apr 2009 20:06:04 +0000 (20:06 +0000)
committerbdemsky <bdemsky>
Thu, 9 Apr 2009 20:06:04 +0000 (20:06 +0000)
Robust/src/IR/Flat/BuildFlat.java

index ce4ad990307d2911ed6ea9c24648dfc34d5e4e52..2ebadbac0767a865805f72e96fb36c7e656e1cc8 100644 (file)
@@ -45,14 +45,11 @@ public class BuildFlat {
     FlatNode fn=np.getBegin();
     fe=new FlatExit();
     FlatNode fn2=np.getEnd();
-    if ( fn2 == null || fn2.kind()!=FKind.FlatReturnNode) {
+
+    if (fn2!=null&& fn2.kind()!=FKind.FlatReturnNode) {
       FlatReturnNode rnflat=new FlatReturnNode(null);
       rnflat.addNext(fe);
-      if( fn2 == null ) {
-       np.end = rnflat;
-      } else {
-       fn2.addNext(rnflat);
-      }
+      fn2.addNext(rnflat);
     }
 
     FlatFlagActionNode ffan=new FlatFlagActionNode(FlatFlagActionNode.PRE);
@@ -136,7 +133,7 @@ public class BuildFlat {
        FlatCall fc=new FlatCall(memd, null, thistd, new TempDescriptor[0]);
        fc.addNext(fn);
        fn=fc;
-       if (np.getEnd().kind()!=FKind.FlatReturnNode) {
+       if (np.getEnd()!=null&&np.getEnd().kind()!=FKind.FlatReturnNode) {
          MethodDescriptor memdex=(MethodDescriptor)typeutil.getClass("Object").getMethodTable().get("MonitorExit");
          FlatCall fcunlock=new FlatCall(memdex, null, thistd, new TempDescriptor[0]);
          np.getEnd().addNext(fcunlock);
@@ -147,7 +144,7 @@ public class BuildFlat {
       } else if (state.DSM&&currmd.getModifiers().isAtomic()) {
        curran.addNext(fn);
        fn=curran;
-       if (np.getEnd().kind()!=FKind.FlatReturnNode) {
+       if (np.getEnd()!=null&&np.getEnd().kind()!=FKind.FlatReturnNode) {
          FlatAtomicExitNode aen=new FlatAtomicExitNode(curran);
          np.getEnd().addNext(aen);
          FlatReturnNode rnflat=new FlatReturnNode(null);