* eval.c (rb_call_super): should search superclass method based on
orig_func, not last_func. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3904 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
7db609e8bd
commit
45c7ea552d
@ -1,3 +1,8 @@
|
|||||||
|
Tue Jun 3 22:20:49 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||||
|
|
||||||
|
* eval.c (rb_call_super): should search superclass method based on
|
||||||
|
orig_func, not last_func.
|
||||||
|
|
||||||
Tue Jun 3 09:59:27 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
|
Tue Jun 3 09:59:27 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||||
|
|
||||||
* eval.c (rb_call_super): inheritance line adjustment moved from
|
* eval.c (rb_call_super): inheritance line adjustment moved from
|
||||||
|
18
eval.c
18
eval.c
@ -5178,24 +5178,22 @@ rb_call_super(argc, argv)
|
|||||||
}
|
}
|
||||||
|
|
||||||
self = ruby_frame->self;
|
self = ruby_frame->self;
|
||||||
klass = CLASS_OF(self);
|
klass = ruby_frame->last_class;
|
||||||
k = ruby_frame->last_class;
|
if (BUILTIN_TYPE(klass) == T_MODULE) {
|
||||||
if (BUILTIN_TYPE(k) == T_MODULE) {
|
k = CLASS_OF(self);
|
||||||
while (!(BUILTIN_TYPE(klass) == T_ICLASS && RBASIC(klass)->klass == k)) {
|
while (!(BUILTIN_TYPE(k) == T_ICLASS && RBASIC(k)->klass == klass)) {
|
||||||
klass = RCLASS(klass)->super;
|
k = RCLASS(k)->super;
|
||||||
if (!klass) {
|
if (!k) {
|
||||||
rb_raise(rb_eTypeError, "%s is not included in %s",
|
rb_raise(rb_eTypeError, "%s is not included in %s",
|
||||||
rb_class2name(k),
|
rb_class2name(klass),
|
||||||
rb_class2name(CLASS_OF(self)));
|
rb_class2name(CLASS_OF(self)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
else {
|
|
||||||
klass = k;
|
klass = k;
|
||||||
}
|
}
|
||||||
|
|
||||||
PUSH_ITER(ruby_iter->iter?ITER_PRE:ITER_NOT);
|
PUSH_ITER(ruby_iter->iter?ITER_PRE:ITER_NOT);
|
||||||
result = rb_call(RCLASS(klass)->super, self, ruby_frame->last_func, argc, argv, 3);
|
result = rb_call(RCLASS(klass)->super, self, ruby_frame->orig_func, argc, argv, 3);
|
||||||
POP_ITER();
|
POP_ITER();
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user