From 65e75be42d22f05f2b151219d66d11c50a251543 Mon Sep 17 00:00:00 2001 From: David Given Date: Sat, 1 Oct 2016 23:41:35 +0200 Subject: [PATCH] Fix edge case where leftover pushes would occasionally cause infinite loops in the analysis. --- mach/proto/mcg/pass_convertstackops.c | 5 +++++ 1 file changed, 5 insertions(+) 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