From 206386b193f1fb0b06f009208b43dd57c5ccb81e Mon Sep 17 00:00:00 2001 From: Stephen Weeks Date: Wed, 1 Oct 2008 22:07:23 -0600 Subject: [PATCH] [imcc] * Possibly fix an infinite loop in compute_dominance_frontiers. --- compilers/imcc/cfg.c | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/compilers/imcc/cfg.c b/compilers/imcc/cfg.c index 03f2cbf..31236c9 100644 --- a/compilers/imcc/cfg.c +++ b/compilers/imcc/cfg.c @@ -1137,7 +1137,10 @@ compute_dominance_frontiers(PARROT_INTERP, ARGMOD(IMC_Unit *unit)) /* while runner != idoms[b] */ while (runner >= 0 && runner != unit->idoms[b]) { /* add b to runner's dominance frontier set */ - set_add(unit->dominance_frontiers[runner], b); + if (set_contains(unit->dominance_frontiers[runner], b)) + runner = 0; + else + set_add(unit->dominance_frontiers[runner], b); /* runner = idoms[runner] */ if (runner == 0) -- 1.5.5.1