Skip to content

Commit

Permalink
Proc#call needs to reserve at least 2 registers; fix #3606
Browse files Browse the repository at this point in the history
One for the receiver, the other for the block.
  • Loading branch information
matz committed Apr 13, 2017
1 parent 17377af commit 045e78c
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/proc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down

0 comments on commit 045e78c

Please sign in to comment.