From 89fef02f1305887d97ddcf96cc4df9109ce414e2 Mon Sep 17 00:00:00 2001 From: nobu Date: Thu, 6 Oct 2011 07:29:33 +0000 Subject: * vm_eval.c (make_no_method_execption): extract from raise_method_missing(). * vm_eval.c (send_internal): remove inadvertent symbol creation from public_send. based on a patch by Jeremy Evans in [ruby-core:38576]. [Feature #5112] * vm_insnhelper.c (vm_call_method): remove inadvertent symbol creation from send and __send__, too. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33419 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- vm_insnhelper.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'vm_insnhelper.c') diff --git a/vm_insnhelper.c b/vm_insnhelper.c index 7f38ccf7c1..68eb3093b8 100644 --- a/vm_insnhelper.c +++ b/vm_insnhelper.c @@ -584,7 +584,17 @@ vm_call_method(rb_thread_t *th, rb_control_frame_t *cfp, } sym = TOPN(i); - id = SYMBOL_P(sym) ? SYM2ID(sym) : rb_to_id(sym); + if (SYMBOL_P(sym)) { + id = SYM2ID(sym); + } + else if (!(id = rb_check_id(&sym))) { + if (rb_method_basic_definition_p(CLASS_OF(recv), idMethodMissing)) { + VALUE exc = make_no_method_execption(rb_eNoMethodError, NULL, recv, + rb_long2int(num), &TOPN(i)); + rb_exc_raise(exc); + } + id = rb_to_id(sym); + } /* shift arguments */ if (i > 0) { MEMMOVE(&TOPN(i), &TOPN(i-1), VALUE, i); -- cgit v1.2.3