aboutsummaryrefslogtreecommitdiff
path: root/spill.c
diff options
context:
space:
mode:
authorQuentin Carbonneaux <[email protected]>2019-04-08 11:52:44 +0200
committerQuentin Carbonneaux <[email protected]>2019-04-08 11:52:44 +0200
commitd84f5fcbb75dcf8f6ff1f12e7509d05598a4b561 (patch)
tree1cdff8a0d6fc3200ea793ba1c848d95375010ebd /spill.c
parentf622efa05a3fbd4938d1fb09e692ae0785770bc1 (diff)
make sure a spill slot is initialized
If an instruction does not have a result, the variable `s` is not set. This could lead to a bogus slot assignment.
Diffstat (limited to 'spill.c')
-rw-r--r--spill.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/spill.c b/spill.c
index f0b593a..0742caa 100644
--- a/spill.c
+++ b/spill.c
@@ -404,6 +404,7 @@ spill(Fn *fn)
continue;
}
bszero(w);
+ s = -1;
if (!req(i->to, R)) {
assert(rtype(i->to) == RTmp);
t = i->to.val;