From 72988e6aa899ab5f13620d0f7eb5b9e44fdf262e Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Wed, 24 Feb 2016 09:40:18 -0500 Subject: oops, phi nodes rewrite for fast locals was trashed The phi fixing mechanism can use emit(), so we need to set curi before performing the rewrite. Otherwise, we are writing at random places in the instruction buffer (not so bad because it is bounds checked), but then we loose the instructions written (bad)! --- lisc/isel.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisc/isel.c b/lisc/isel.c index 8ae4be7..499a6e0 100644 --- a/lisc/isel.c +++ b/lisc/isel.c @@ -944,6 +944,7 @@ isel(Fn *fn) n = fn->ntmp; ainfo = emalloc(n * sizeof ainfo[0]); for (b=fn->start; b; b=b->link) { + curi = &insb[NIns]; for (sb=(Blk*[3]){b->s1, b->s2, 0}; *sb; sb++) for (p=(*sb)->phi; p; p=p->link) { for (a=0; p->blk[a] != b; a++) @@ -953,7 +954,6 @@ isel(Fn *fn) for (m=0; mcon); - curi = &insb[NIns]; seljmp(b, fn); for (i=&b->ins[b->nins]; i!=b->ins;) sel(*--i, ainfo, fn); -- cgit 1.4.1