Set regs to stack on return of const_get calls before use

This commit is contained in:
Carson McDonald
2013-10-15 07:33:41 -04:00
parent a7c9a71684
commit 11c4d81539
+6 -2
View File
@@ -702,7 +702,9 @@ mrb_run(mrb_state *mrb, struct RProc *proc, mrb_value self)
CASE(OP_GETCONST) {
/* A B R(A) := constget(Sym(B)) */
ERR_PC_HOOK(mrb, pc);
regs[GETARG_A(i)] = mrb_vm_const_get(mrb, syms[GETARG_Bx(i)]);
mrb_value val = mrb_vm_const_get(mrb, syms[GETARG_Bx(i)]);
regs = mrb->c->stack;
regs[GETARG_A(i)] = val;
NEXT;
}
@@ -717,7 +719,9 @@ mrb_run(mrb_state *mrb, struct RProc *proc, mrb_value self)
int a = GETARG_A(i);
ERR_PC_HOOK(mrb, pc);
regs[a] = mrb_const_get(mrb, regs[a], syms[GETARG_Bx(i)]);
mrb_value val = mrb_const_get(mrb, regs[a], syms[GETARG_Bx(i)]);
regs = mrb->c->stack;
regs[a] = val;
NEXT;
}