From 0cc7cd22cf71bdc3a1e9291187bdfda13257cff9 Mon Sep 17 00:00:00 2001 From: nobu Date: Thu, 30 Jan 2014 10:32:32 +0000 Subject: [PATCH] vm_eval.c: fix NoMethodError message * vm_eval.c (vm_call0_body): reuse method type. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44763 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- vm_eval.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/vm_eval.c b/vm_eval.c index 9ed7a39ab2..522c26114d 100644 --- a/vm_eval.c +++ b/vm_eval.c @@ -188,8 +188,8 @@ vm_call0_body(rb_thread_t* th, rb_call_info_t *ci, const VALUE *argv) case VM_METHOD_TYPE_ZSUPER: case VM_METHOD_TYPE_REFINED: { - int ex = ci->me->def->type == VM_METHOD_TYPE_ZSUPER ? NOEX_SUPER : 0; - if (ci->me->def->type == VM_METHOD_TYPE_REFINED && + const rb_method_type_t type = ci->me->def->type; + if (type == VM_METHOD_TYPE_REFINED && ci->me->def->body.orig_me) { ci->me = ci->me->def->body.orig_me; goto again; @@ -198,6 +198,7 @@ vm_call0_body(rb_thread_t* th, rb_call_info_t *ci, const VALUE *argv) ci->defined_class = RCLASS_SUPER(ci->defined_class); if (!ci->defined_class || !(ci->me = rb_method_entry(ci->defined_class, ci->mid, &ci->defined_class))) { + int ex = VM_METHOD_TYPE_ZSUPER ? NOEX_SUPER : 0; ret = method_missing(ci->recv, ci->mid, ci->argc, argv, ex); goto success; }