diff --git a/compile.c b/compile.c index 62b5bbc490..a9fe5ce114 100644 --- a/compile.c +++ b/compile.c @@ -1439,16 +1439,16 @@ new_callinfo(rb_iseq_t *iseq, ID mid, int argc, unsigned int flag, struct rb_cal { VM_ASSERT(argc >= 0); - if (!(flag & (VM_CALL_ARGS_SPLAT | VM_CALL_ARGS_BLOCKARG | VM_CALL_KW_SPLAT | VM_CALL_FORWARDING)) && - kw_arg == NULL && !has_blockiseq) { - flag |= VM_CALL_ARGS_SIMPLE; - } - if (kw_arg) { flag |= VM_CALL_KWARG; argc += kw_arg->keyword_len; } + if (!(flag & (VM_CALL_ARGS_SPLAT | VM_CALL_ARGS_BLOCKARG | VM_CALL_KWARG | VM_CALL_KW_SPLAT | VM_CALL_FORWARDING)) + && !has_blockiseq) { + flag |= VM_CALL_ARGS_SIMPLE; + } + ISEQ_BODY(iseq)->ci_size++; const struct rb_callinfo *ci = vm_ci_new(mid, flag, argc, kw_arg); RB_OBJ_WRITTEN(iseq, Qundef, ci); diff --git a/vm_callinfo.h b/vm_callinfo.h index ccc28eb527..bb4e46e758 100644 --- a/vm_callinfo.h +++ b/vm_callinfo.h @@ -17,7 +17,7 @@ enum vm_call_flag_bits { VM_CALL_ARGS_BLOCKARG_bit, // m(&block) VM_CALL_FCALL_bit, // m(args) # receiver is self VM_CALL_VCALL_bit, // m # method call that looks like a local variable - VM_CALL_ARGS_SIMPLE_bit, // (ci->flag & (SPLAT|BLOCKARG)) && blockiseq == NULL && ci->kw_arg == NULL + VM_CALL_ARGS_SIMPLE_bit, // !(ci->flag & (SPLAT|BLOCKARG|KWARG|KW_SPLAT|FORWARDING)) && !has_block_iseq VM_CALL_KWARG_bit, // has kwarg VM_CALL_KW_SPLAT_bit, // m(**opts) VM_CALL_TAILCALL_bit, // located at tail position