Fix edge case where leftover pushes would occasionally cause infinite loops in
authorDavid Given <dg@cowlark.com>
Sat, 1 Oct 2016 21:41:35 +0000 (23:41 +0200)
committerDavid Given <dg@cowlark.com>
Sat, 1 Oct 2016 21:41:35 +0000 (23:41 +0200)
the analysis.

mach/proto/mcg/pass_convertstackops.c

index c34eddf..f576448 100644 (file)
@@ -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<pushes.count; i++)