diff options
| author | Carson McDonald <[email protected]> | 2013-10-15 07:33:41 -0400 |
|---|---|---|
| committer | Carson McDonald <[email protected]> | 2013-10-15 07:33:41 -0400 |
| commit | 11c4d81539eca8198bc702a91c8607c06e04e61e (patch) | |
| tree | 2ac9e802dbe37ddd949eaf67a1712eaf9dd9536f /src | |
| parent | a7c9a71684fccf8121f16803f8e3d758f0dea001 (diff) | |
| download | mruby-11c4d81539eca8198bc702a91c8607c06e04e61e.tar.gz mruby-11c4d81539eca8198bc702a91c8607c06e04e61e.zip | |
Set regs to stack on return of const_get calls before use
Diffstat (limited to 'src')
| -rw-r--r-- | src/vm.c | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -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; } |
