diff options
Diffstat (limited to 'insns.def')
-rw-r--r-- | insns.def | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -947,11 +947,18 @@ invokeblock (VALUE val) // inc += 1 - ci->orig_argc; { struct rb_calling_info calling; + VALUE block_handler; + calling.argc = ci->orig_argc; calling.block_handler = VM_BLOCK_HANDLER_NONE; calling.recv = Qundef; /* should not be used */ - val = vm_invoke_block(ec, GET_CFP(), &calling, ci); + block_handler = VM_CF_BLOCK_HANDLER(GET_CFP()); + if (block_handler == VM_BLOCK_HANDLER_NONE) { + rb_vm_localjump_error("no block given (yield)", Qnil, 0); + } + + val = vm_invoke_block(ec, GET_CFP(), &calling, ci, block_handler); if (val == Qundef) { RESTORE_REGS(); NEXT_INSN(); |