summaryrefslogtreecommitdiff
path: root/eval.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-11-01 13:45:00 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-11-01 13:45:00 +0000
commit90509da4251f84a3a975e764e16a78d8b7c96753 (patch)
tree1253b75aef5bff18d27cf619508bfe5068ff0fcc /eval.c
parentcdcfcef20f55642d07afc575fa9b6192123e3e7b (diff)
* eval.c (rb_call_super): should call method_missing if super is
called from Kernel method. * eval.c (exec_under): frame during eval should preserve external information. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@9491 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'eval.c')
-rw-r--r--eval.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/eval.c b/eval.c
index e1d2c94ca2..c11f0c42d8 100644
--- a/eval.c
+++ b/eval.c
@@ -6080,6 +6080,9 @@ rb_call_super(argc, argv)
self = ruby_frame->self;
klass = ruby_frame->last_class;
+ if (RCLASS(klass)->super == 0) {
+ return method_missing(self, ruby_frame->last_func, argc, argv, CSTAT_SUPER);
+ }
PUSH_ITER(ruby_iter->iter ? ITER_PRE : ITER_NOT);
result = rb_call(RCLASS(klass)->super, self, ruby_frame->orig_func, argc, argv, 3);
@@ -6439,14 +6442,16 @@ exec_under(func, under, cbase, args)
VALUE val = Qnil; /* OK */
int state;
int mode;
+ struct FRAME *f = ruby_frame->prev;
PUSH_CLASS(under);
PUSH_FRAME();
- ruby_frame->self = _frame.prev->self;
- ruby_frame->last_func = _frame.prev->last_func;
- ruby_frame->last_class = _frame.prev->last_class;
- ruby_frame->argc = _frame.prev->argc;
- ruby_frame->argv = _frame.prev->argv;
+ ruby_frame->self = f->self;
+ ruby_frame->last_func = f->last_func;
+ ruby_frame->orig_func = f->orig_func;
+ ruby_frame->last_class = f->last_class;
+ ruby_frame->argc = f->argc;
+ ruby_frame->argv = f->argv;
if (cbase) {
PUSH_CREF(cbase);
}