From: David Given Date: Sat, 1 Oct 2016 21:41:35 +0000 (+0200) Subject: Fix edge case where leftover pushes would occasionally cause infinite loops in X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=65e75be42d22f05f2b151219d66d11c50a251543;p=ack.git Fix edge case where leftover pushes would occasionally cause infinite loops in the analysis. --- diff --git a/mach/proto/mcg/pass_convertstackops.c b/mach/proto/mcg/pass_convertstackops.c index c34eddf16..f5764484a 100644 --- a/mach/proto/mcg/pass_convertstackops.c +++ b/mach/proto/mcg/pass_convertstackops.c @@ -107,6 +107,11 @@ static void convert_block(struct procedure* proc, struct basicblock* bb) } } + /* If we didn't actually find anything, give up. */ + + if ((pushes.count == 0) || (pops.count == 0)) + return; + /* Okay, now we can wire them all up. */ for (i=0; i