Fixed self value in a block is changed with return value

fix #1504
This commit is contained in:
Keita Obo
2013-09-18 00:20:13 +09:00
parent ccadbbeb84
commit 0bce3a36d2
2 changed files with 17 additions and 2 deletions
+1 -2
View File
@@ -286,8 +286,7 @@ genop_peep(codegen_scope *s, mrb_code i, int val)
case OP_RANGE:
case OP_AREF:
case OP_GETUPVAR:
s->iseq[s->pc-1] = MKOP_ABC(c0, 0, GETARG_B(i0), GETARG_C(i0));
genop(s, MKOP_AB(OP_RETURN, 0, OP_R_NORMAL));
genop(s, MKOP_AB(OP_RETURN, GETARG_A(i0), OP_R_NORMAL));
return;
case OP_SETIV:
case OP_SETCV: