summary refs log tree commit diff
diff options
context:
space:
mode:
authorMichael Forney <mforney@mforney.org>2019-02-17 15:26:03 -0800
committerQuentin Carbonneaux <quentin@c9x.me>2019-02-21 09:30:40 +0100
commit44fbc6023793b2f7dd7af42a94a8e5c5a515537d (patch)
tree2e6ffdebe02f585cdd6a45ac5d7a0f5446b52498
parentdad4550dfb735e8043d65d18edae52f4f7b2e21c (diff)
downloadroux-44fbc6023793b2f7dd7af42a94a8e5c5a515537d.tar.gz
Fix assertion failure if temporary was spilled in all predecessors
Since ce0ab53ed7, we skip over predecessors that spilled the
temporary. However, if all predecessors spilled, then we might not have
an entry in `rl`, triggering an assertion failure in the following loop.
-rw-r--r--rega.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/rega.c b/rega.c
index 9ceba70..6f1da50 100644
--- a/rega.c
+++ b/rega.c
@@ -591,6 +591,8 @@ rega(Fn *fn)
 					continue;
 				rl[r] = (!rl[r] || rl[r] == x) ? x : -1;
 			}
+			if (rl[r] == 0)
+				rl[r] = -1;
 		}
 
 		npm = 0;