summaryrefslogtreecommitdiff
path: root/vm_insnhelper.c
diff options
context:
space:
mode:
Diffstat (limited to 'vm_insnhelper.c')
-rw-r--r--vm_insnhelper.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/vm_insnhelper.c b/vm_insnhelper.c
index abf74d7491..cfac3a4dce 100644
--- a/vm_insnhelper.c
+++ b/vm_insnhelper.c
@@ -410,13 +410,14 @@ vm_method_missing(rb_thread_t *th, ID id, VALUE recv,
int num, rb_block_t *blockptr, int opt)
{
rb_control_frame_t * const reg_cfp = th->cfp;
- VALUE *argv = STACK_ADDR_FROM_TOP(num + 1);
+ VALUE *argv = ALLOCA_N(VALUE, num + 1);
+ MEMCPY(argv, STACK_ADDR_FROM_TOP(num + 1), VALUE, num + 1);
VALUE val;
argv[0] = ID2SYM(id);
th->method_missing_reason = opt;
th->passed_block = blockptr;
- val = rb_funcall2(recv, idMethodMissing, num + 1, argv);
POPN(num + 1);
+ val = rb_funcall2(recv, idMethodMissing, num + 1, argv);
return val;
}