Commit 11c4d815 authored by Carson McDonald's avatar Carson McDonald

Set regs to stack on return of const_get calls before use

parent a7c9a716
...@@ -702,7 +702,9 @@ mrb_run(mrb_state *mrb, struct RProc *proc, mrb_value self) ...@@ -702,7 +702,9 @@ mrb_run(mrb_state *mrb, struct RProc *proc, mrb_value self)
CASE(OP_GETCONST) { CASE(OP_GETCONST) {
/* A B R(A) := constget(Sym(B)) */ /* A B R(A) := constget(Sym(B)) */
ERR_PC_HOOK(mrb, pc); 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; NEXT;
} }
...@@ -717,7 +719,9 @@ mrb_run(mrb_state *mrb, struct RProc *proc, mrb_value self) ...@@ -717,7 +719,9 @@ mrb_run(mrb_state *mrb, struct RProc *proc, mrb_value self)
int a = GETARG_A(i); int a = GETARG_A(i);
ERR_PC_HOOK(mrb, pc); 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; NEXT;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment