Permalink
Browse files

Preserve the current pc before `method_missing()`; fix #3660

  • Loading branch information...
matz committed May 25, 2017
1 parent 9644ad5 commit 9bca887ac454770a8d759832853a78a5fc942147
Showing with 3 additions and 0 deletions.
  1. +3 −0 src/vm.c
View
@@ -1273,6 +1273,7 @@ mrb_vm_exec(mrb_state *mrb, struct RProc *proc, mrb_code *pc)
else {
args = mrb_ary_new_from_values(mrb, n, regs+a+1);
}
ERR_PC_SET(mrb, pc);
mrb_method_missing(mrb, mid, recv, args);
}
mid = missing;
@@ -1460,6 +1461,7 @@ mrb_vm_exec(mrb_state *mrb, struct RProc *proc, mrb_code *pc)
else {
args = mrb_ary_new_from_values(mrb, n, regs+a+1);
}
ERR_PC_SET(mrb, pc);
mrb_method_missing(mrb, mid, recv, args);
}
mid = missing;
@@ -1941,6 +1943,7 @@ mrb_vm_exec(mrb_state *mrb, struct RProc *proc, mrb_code *pc)
else {
args = mrb_ary_new_from_values(mrb, n, regs+a+1);
}
ERR_PC_SET(mrb, pc);
mrb_method_missing(mrb, mid, recv, args);
}
mid = missing;

0 comments on commit 9bca887

Please sign in to comment.