Bladeren bron

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.
Quentin Carbonneaux 6 jaren geleden
bovenliggende
commit
d84f5fcbb7
1 gewijzigde bestanden met toevoegingen van 1 en 0 verwijderingen
  1. 1 0
      spill.c

+ 1 - 0
spill.c

@@ -404,6 +404,7 @@ spill(Fn *fn)
 				continue;
 				continue;
 			}
 			}
 			bszero(w);
 			bszero(w);
+			s = -1;
 			if (!req(i->to, R)) {
 			if (!req(i->to, R)) {
 				assert(rtype(i->to) == RTmp);
 				assert(rtype(i->to) == RTmp);
 				t = i->to.val;
 				t = i->to.val;