diff options
author | 卜部昌平 <shyouhei@ruby-lang.org> | 2019-10-28 14:36:28 +0900 |
---|---|---|
committer | 卜部昌平 <shyouhei@ruby-lang.org> | 2019-10-28 14:38:05 +0900 |
commit | cc5580f175bb55c9a1d7574c1861f405ee972617 (patch) | |
tree | a943ed1d5bbb1e9810f5bdba49526bdb50f1f3db /vm_insnhelper.c | |
parent | a72cb6b11d777c2268831df4f21ab56851db425c (diff) | |
download | ruby-cc5580f175bb55c9a1d7574c1861f405ee972617.tar.gz |
fix bug in keyword + protected combination
Test included for the situation formerly was not working.
Diffstat (limited to 'vm_insnhelper.c')
-rw-r--r-- | vm_insnhelper.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/vm_insnhelper.c b/vm_insnhelper.c index 211a525c4e..a4bc276f04 100644 --- a/vm_insnhelper.c +++ b/vm_insnhelper.c @@ -2879,8 +2879,15 @@ vm_call_method(rb_execution_context_t *ec, rb_control_frame_t *cfp, struct rb_ca else { /* caching method info to dummy cc */ VM_ASSERT(cc->me != NULL); - struct rb_call_data cd_entry = *cd; - return vm_call_method_each_type(ec, cfp, calling, &cd_entry); + if (ci->flag & VM_CALL_KWARG) { + struct rb_kwarg_call_data *kcd = (void *)cd; + struct rb_kwarg_call_data cd_entry = *kcd; + return vm_call_method_each_type(ec, cfp, calling, (void *)&cd_entry); + } + else { + struct rb_call_data cd_entry = *cd; + return vm_call_method_each_type(ec, cfp, calling, &cd_entry); + } } } return vm_call_method_each_type(ec, cfp, calling, cd); |