summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2017-12-13 08:43:15 +0900
committerYukihiro "Matz" Matsumoto <[email protected]>2017-12-13 08:43:15 +0900
commit11b6696ce24921f03236631905b123ffce12321c (patch)
tree5d37572a1277ca7fc5782da3b3112c1410c9c95f
parente647b16d1d57525f6eda80fac50c6f242f8fb101 (diff)
downloadmruby-11b6696ce24921f03236631905b123ffce12321c.tar.gz
mruby-11b6696ce24921f03236631905b123ffce12321c.zip
Retrieve operands at the beginning of `OP_SCLASS`.
-rw-r--r--src/vm.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/vm.c b/src/vm.c
index 45e05268c..464e9042d 100644
--- a/src/vm.c
+++ b/src/vm.c
@@ -2867,7 +2867,10 @@ RETRY_TRY_BLOCK:
CASE(OP_SCLASS) {
/* A B R(A) := R(B).singleton_class */
- regs[GETARG_A(i)] = mrb_singleton_class(mrb, regs[GETARG_B(i)]);
+ int a = GETARG_A(i);
+ int b = GETARG_B(i);
+
+ regs[a] = mrb_singleton_class(mrb, regs[b]);
mrb_gc_arena_restore(mrb, ai);
NEXT;
}