too much peephole optimization; close #1992

This commit is contained in:
Yukihiro "Matz" Matsumoto
2014-04-03 10:14:38 +09:00
parent 8eaee91892
commit 5be2bfb523
+5 -2
View File
@@ -276,8 +276,11 @@ genop_peep(codegen_scope *s, mrb_code i, int val)
case OP_RETURN:
return 0;
case OP_MOVE:
s->iseq[s->pc-1] = MKOP_AB(OP_RETURN, GETARG_B(i0), OP_R_NORMAL);
return 0;
if (GETARG_A(i0) >= s->nlocals) {
s->iseq[s->pc-1] = MKOP_AB(OP_RETURN, GETARG_B(i0), OP_R_NORMAL);
return 0;
}
break;
case OP_SETIV:
case OP_SETCV:
case OP_SETCONST: