* Removed all Id tags.
[cacao.git] / src / vm / jit / cfg.c
index ef4456b7bff42374b978ec56c1c7e69c516509f8..4163852371c5261bf9242c1c3aedd4d00928f033 100644 (file)
@@ -28,8 +28,6 @@
 
    Changes: Edwin Steiner
 
-   $Id: cacao.c 4357 2006-01-22 23:33:38Z twisti $
-
 */
 
 
@@ -114,7 +112,6 @@ static void cfg_insert_predecessors(basicblock *bptr, basicblock *pbptr)
 
 bool cfg_build(jitdata *jd)
 {
-       methodinfo      *m;
        basicblock      *bptr;
        basicblock      *tbptr;
        basicblock      *ntbptr;
@@ -123,10 +120,6 @@ bool cfg_build(jitdata *jd)
        lookup_target_t *lookup;
        s4               i;
 
-       /* get required compiler data */
-
-       m = jd->m;
-
        /* process all basic blocks to find the predecessor/successor counts */
 
        bptr = jd->basicblocks;
@@ -241,7 +234,11 @@ bool cfg_build(jitdata *jd)
                        bptr->successorcount++;
 
                        tbptr = bptr->next;
-                       tbptr->predecessorcount++;
+
+                       /* An exception handler has no predecessors. */
+
+                       if (tbptr->type != BBTYPE_EXH)
+                               tbptr->predecessorcount++;
                        break;
                }
        }
@@ -399,10 +396,14 @@ goto_tail:
                        bptr->successors[0] = tbptr;
                        bptr->successorcount++;
 
-                       cfg_allocate_predecessors(tbptr);
+                       /* An exception handler has no predecessors. */
 
-                       tbptr->predecessors[tbptr->predecessorcount] = bptr;
-                       tbptr->predecessorcount++;
+                       if (tbptr->type != BBTYPE_EXH) {
+                               cfg_allocate_predecessors(tbptr);
+
+                               tbptr->predecessors[tbptr->predecessorcount] = bptr;
+                               tbptr->predecessorcount++;
+                       }
                        break;
                }
        }