summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-06-03 13:57:06 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-06-03 13:57:06 +0000
commit45c7ea552d0293aa217bbb496d4238754ba701d2 (patch)
treebbdbc9c60213451f3d76137b9a8cc61ab78a8c54
parent7db609e8bd2fcf604fe79a56bb026278c1b681c2 (diff)
* 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
-rw-r--r--ChangeLog5
-rw-r--r--eval.c18
2 files changed, 13 insertions, 10 deletions
diff --git a/ChangeLog b/ChangeLog
index 328fef9463b..836d1376aca 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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>
* eval.c (rb_call_super): inheritance line adjustment moved from
diff --git a/eval.c b/eval.c
index fbfb745ca11..f4b4f897c26 100644
--- a/eval.c
+++ b/eval.c
@@ -5178,24 +5178,22 @@ rb_call_super(argc, argv)
}
self = ruby_frame->self;
- klass = CLASS_OF(self);
- k = ruby_frame->last_class;
- if (BUILTIN_TYPE(k) == T_MODULE) {
- while (!(BUILTIN_TYPE(klass) == T_ICLASS && RBASIC(klass)->klass == k)) {
- klass = RCLASS(klass)->super;
- if (!klass) {
+ klass = ruby_frame->last_class;
+ if (BUILTIN_TYPE(klass) == T_MODULE) {
+ k = CLASS_OF(self);
+ while (!(BUILTIN_TYPE(k) == T_ICLASS && RBASIC(k)->klass == klass)) {
+ k = RCLASS(k)->super;
+ if (!k) {
rb_raise(rb_eTypeError, "%s is not included in %s",
- rb_class2name(k),
+ rb_class2name(klass),
rb_class2name(CLASS_OF(self)));
}
}
- }
- else {
klass = k;
}
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();
return result;