summaryrefslogtreecommitdiffhomepage
path: root/src/proc.c
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2017-04-13 11:02:02 +0900
committerYukihiro "Matz" Matsumoto <[email protected]>2017-04-13 11:02:02 +0900
commit045e78c844289694cf36415261644d362ff2fd21 (patch)
tree9b878ad534cbcd7937a817bdc892b1a2ad1747d3 /src/proc.c
parent17377af984feb8ef44a0b0f1ac30d87033be5d1a (diff)
downloadmruby-045e78c844289694cf36415261644d362ff2fd21.tar.gz
mruby-045e78c844289694cf36415261644d362ff2fd21.zip
Proc#call needs to reserve at least 2 registers; fix #3606
One for the receiver, the other for the block.
Diffstat (limited to 'src/proc.c')
-rw-r--r--src/proc.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/proc.c b/src/proc.c
index ab22bc1fa..3955c0a1a 100644
--- a/src/proc.c
+++ b/src/proc.c
@@ -271,6 +271,7 @@ mrb_init_proc(mrb_state *mrb)
call_irep->flags = MRB_ISEQ_NO_FREE;
call_irep->iseq = call_iseq;
call_irep->ilen = 1;
+ call_irep->nregs = 2; /* receiver and block */
mrb_define_class_method(mrb, mrb->proc_class, "new", mrb_proc_s_new, MRB_ARGS_ANY());
mrb_define_method(mrb, mrb->proc_class, "initialize_copy", mrb_proc_init_copy, MRB_ARGS_REQ(1));