diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2013-10-15 15:34:33 -0700 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2013-10-15 15:34:33 -0700 |
| commit | def683ae72827a20b99ef1129dd59ea8f0c891dd (patch) | |
| tree | 2ac9e802dbe37ddd949eaf67a1712eaf9dd9536f /src/vm.c | |
| parent | a7c9a71684fccf8121f16803f8e3d758f0dea001 (diff) | |
| parent | 11c4d81539eca8198bc702a91c8607c06e04e61e (diff) | |
| download | mruby-def683ae72827a20b99ef1129dd59ea8f0c891dd.tar.gz mruby-def683ae72827a20b99ef1129dd59ea8f0c891dd.zip | |
Merge pull request #1538 from carsonmcdonald/conststackfix
Set regs to stack on return of const_get calls before use
Diffstat (limited to 'src/vm.c')
| -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; } |
