summary refs log tree commit diff
diff options
context:
space:
mode:
authorQuentin Carbonneaux <quentin.carbonneaux@yale.edu>2016-02-16 22:17:18 -0500
committerQuentin Carbonneaux <quentin.carbonneaux@yale.edu>2016-02-16 22:17:18 -0500
commit70d73e2d6eaf0bca7821222b7ba0be41d838080b (patch)
tree805e230333f9834b0f5042af2a1d1a817c687bdc
parent7d203e7f9994d89ddabfd6903c9f9019e9485447 (diff)
downloadroux-70d73e2d6eaf0bca7821222b7ba0be41d838080b.tar.gz
fix dumb bug found by Andrew Chambers
-rw-r--r--lisc/mem.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/lisc/mem.c b/lisc/mem.c
index ea4bd82..75eacb8 100644
--- a/lisc/mem.c
+++ b/lisc/mem.c
@@ -29,8 +29,9 @@ memopt(Fn *fn)
 			if (u->type != UIns)
 				goto NextIns;
 			l = u->u.ins;
-			if (l->op < OStorel || l->op > OStoreb)
 			if (l->op < OLoadl || l->op > OLoadub)
+			if (l->op < OStorel || l->op > OStoreb
+			|| req(i->to, l->arg[0]))
 				goto NextIns;
 		}
 		/* get rid of the alloc and replace uses */