* src/vm/jit/cfg.c (cfg_build): Fixed off by one in predecessorcount for exception...
authorPeter Molnar <pm@complang.tuwien.ac.at>
Sat, 22 Mar 2008 13:51:30 +0000 (14:51 +0100)
committerPeter Molnar <pm@complang.tuwien.ac.at>
Sat, 22 Mar 2008 13:51:30 +0000 (14:51 +0100)
src/vm/jit/cfg.c

index 55832e8d3f9ed2fe5f5ff4efbd1d9465e7417d7a..9cc8260996b94c8d72d0c5268c50dcb6c524a5f1 100644 (file)
@@ -141,6 +141,13 @@ bool cfg_build(jitdata *jd)
        bptr = jd->basicblocks;
 
        for (bptr = jd->basicblocks; bptr != NULL; bptr = bptr->next) {
+
+               if (bptr->type == BBTYPE_EXH) {
+                       /* predecessorcount for exception handlers is initialized to -1,
+                          so we need to fix it to 0. */
+                       bptr->predecessorcount += 1;
+               }
+
                if ((bptr->icount == 0) || (bptr->flags == BBUNDEF))
                        continue;