summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2017-11-17 20:22:13 +0900
committerYukihiro "Matz" Matsumoto <[email protected]>2017-11-18 00:03:59 +0900
commit825e93eba41909f51d7c98a54f7c52fe1835d8ec (patch)
tree545a752928b6b86ddaf3d466f8a2ca396269bf51 /src
parent31ce73ddc30b9369dffdda01903bfa45277a2829 (diff)
downloadmruby-825e93eba41909f51d7c98a54f7c52fe1835d8ec.tar.gz
mruby-825e93eba41909f51d7c98a54f7c52fe1835d8ec.zip
Assign operands to local variables.
Diffstat (limited to 'src')
-rw-r--r--src/vm.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/vm.c b/src/vm.c
index 6bf6877a4..8dfabdafe 100644
--- a/src/vm.c
+++ b/src/vm.c
@@ -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;
}