From 5a6c48980a123f674952d1c9c66cafbfaacf8dfa Mon Sep 17 00:00:00 2001 From: ko1 Date: Wed, 16 Dec 2015 18:20:29 +0000 Subject: * vm_insnhelper.c (vm_call_method_each_type): should not set fastpath with keyword arguments for VM_METHOD_TYPE_ATTRSET type methods. Normally, we can not use keyword arguments for this kind of methods, (obj.foo = 1), but we can set alias names for them. [Bug #11657] * test/ruby/test_keyword.rb: add a test for this fix. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53164 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- vm_insnhelper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'vm_insnhelper.c') diff --git a/vm_insnhelper.c b/vm_insnhelper.c index 3f06b31732..44e7183eb4 100644 --- a/vm_insnhelper.c +++ b/vm_insnhelper.c @@ -2096,7 +2096,7 @@ vm_call_method_each_type(rb_thread_t *th, rb_control_frame_t *cfp, struct rb_cal CALLER_SETUP_ARG(cfp, calling, ci); rb_check_arity(calling->argc, 1, 1); cc->aux.index = 0; - CI_SET_FASTPATH(cc, vm_call_attrset, !(ci->flag & VM_CALL_ARGS_SPLAT)); + CI_SET_FASTPATH(cc, vm_call_attrset, !((ci->flag & VM_CALL_ARGS_SPLAT) || (ci->flag & VM_CALL_KWARG))); return vm_call_attrset(th, cfp, calling, ci, cc); case VM_METHOD_TYPE_IVAR: -- cgit v1.2.3