зеркало из https://github.com/github/ruby.git
vm_eval.c: check exceptional condition first
* vm_eval.c (vm_call_super): check exceptional condition first. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36642 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
906b2110d9
Коммит
281e4b611f
|
@ -160,14 +160,12 @@ vm_call_super(rb_thread_t *th, int argc, const VALUE *argv)
|
|||
rb_method_entry_t *me;
|
||||
rb_control_frame_t *cfp = th->cfp;
|
||||
|
||||
if (!cfp->iseq && !NIL_P(cfp->klass)) {
|
||||
klass = RCLASS_SUPER(cfp->klass);
|
||||
id = cfp->me->def->original_id;
|
||||
}
|
||||
else {
|
||||
if (cfp->iseq || NIL_P(cfp->klass)) {
|
||||
rb_bug("vm_call_super: should not be reached");
|
||||
}
|
||||
|
||||
klass = RCLASS_SUPER(cfp->klass);
|
||||
id = cfp->me->def->original_id;
|
||||
me = rb_method_entry(klass, id, &klass);
|
||||
if (!me) {
|
||||
return method_missing(recv, id, argc, argv, NOEX_SUPER);
|
||||
|
|
Загрузка…
Ссылка в новой задаче