summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorYukihiro Matsumoto <[email protected]>2012-07-05 01:40:23 +0900
committerYukihiro Matsumoto <[email protected]>2012-07-05 01:40:23 +0900
commitca930538eaac4aa64ce65ef6dbf6c60fe3caccab (patch)
treeaab39a650d92ba9c3c77b97722f4b0bc0d211df7
parentc4208a413d2706d2914c5ebe112fe14308090f92 (diff)
downloadmruby-ca930538eaac4aa64ce65ef6dbf6c60fe3caccab.tar.gz
mruby-ca930538eaac4aa64ce65ef6dbf6c60fe3caccab.zip
prepare for OP_TAILCALL
-rw-r--r--src/codegen.c5
-rw-r--r--src/vm.c2
2 files changed, 6 insertions, 1 deletions
diff --git a/src/codegen.c b/src/codegen.c
index 963e94b21..3236713e2 100644
--- a/src/codegen.c
+++ b/src/codegen.c
@@ -2149,6 +2149,11 @@ codedump(mrb_state *mrb, int n)
mrb_sym2name(mrb, irep->syms[GETARG_B(c)]),
GETARG_C(c));
break;
+ case OP_TAILCALL:
+ printf("OP_TAILCALL\tR%d\t:%s\t%d\n", GETARG_A(c),
+ mrb_sym2name(mrb, irep->syms[GETARG_B(c)]),
+ GETARG_C(c));
+ break;
case OP_SUPER:
printf("OP_SUPER\tR%d\t%d\n", GETARG_A(c),
GETARG_C(c));
diff --git a/src/vm.c b/src/vm.c
index d69081c9c..62fba24d0 100644
--- a/src/vm.c
+++ b/src/vm.c
@@ -1120,7 +1120,7 @@ mrb_run(mrb_state *mrb, struct RProc *proc, mrb_value self)
/* replace callinfo */
- mrb->ci = ci = &mrb->ci[-1];
+ ci = mrb->ci;
ci->mid = mid;
ci->target_class = m->target_class;
ci->argc = n;