diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2017-11-17 20:22:13 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2017-11-18 00:03:59 +0900 |
| commit | 825e93eba41909f51d7c98a54f7c52fe1835d8ec (patch) | |
| tree | 545a752928b6b86ddaf3d466f8a2ca396269bf51 /src/vm.c | |
| parent | 31ce73ddc30b9369dffdda01903bfa45277a2829 (diff) | |
| download | mruby-825e93eba41909f51d7c98a54f7c52fe1835d8ec.tar.gz mruby-825e93eba41909f51d7c98a54f7c52fe1835d8ec.zip | |
Assign operands to local variables.
Diffstat (limited to 'src/vm.c')
| -rw-r--r-- | src/vm.c | 15 |
1 files changed, 11 insertions, 4 deletions
@@ -2073,12 +2073,13 @@ RETRY_TRY_BLOCK: CASE(OP_TAILCALL) { /* A B C return call(R(A),Syms(B),R(A+1),... ,R(A+C+1)) */ int a = GETARG_A(i); + int b = GETARG_B(i); int n = GETARG_C(i); struct RProc *m; struct RClass *c; mrb_callinfo *ci; mrb_value recv; - mrb_sym mid = syms[GETARG_B(i)]; + mrb_sym mid = syms[b]; recv = regs[a]; c = mrb_class(mrb, recv); @@ -2679,15 +2680,21 @@ RETRY_TRY_BLOCK: CASE(OP_STRING) { /* A Bx R(A) := str_new(Lit(Bx)) */ - mrb_value str = mrb_str_dup(mrb, pool[GETARG_Bx(i)]); - regs[GETARG_A(i)] = str; + mrb_int a = GETARG_A(i); + mrb_int bx = GETARG_Bx(i); + mrb_value str = mrb_str_dup(mrb, pool[bx]); + + regs[a] = str; mrb_gc_arena_restore(mrb, ai); NEXT; } CASE(OP_STRCAT) { /* A B R(A).concat(R(B)) */ - mrb_str_concat(mrb, regs[GETARG_A(i)], regs[GETARG_B(i)]); + mrb_int a = GETARG_A(i); + mrb_int b = GETARG_B(i); + + mrb_str_concat(mrb, regs[a], regs[b]); NEXT; } |
