From: Peter Molnar Date: Sat, 22 Mar 2008 13:51:30 +0000 (+0100) Subject: * src/vm/jit/cfg.c (cfg_build): Fixed off by one in predecessorcount for exception... X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=commitdiff_plain;h=5e5d11bde485216d28de291688ae40ba4e600092;p=cacao.git * src/vm/jit/cfg.c (cfg_build): Fixed off by one in predecessorcount for exception handler blocks. See #53. --- diff --git a/src/vm/jit/cfg.c b/src/vm/jit/cfg.c index 55832e8d3..9cc826099 100644 --- a/src/vm/jit/cfg.c +++ b/src/vm/jit/cfg.c @@ -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;