diff options
| author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2005-11-01 13:45:00 +0000 |
|---|---|---|
| committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2005-11-01 13:45:00 +0000 |
| commit | b5bfebe4203257227713d08897529a60a6ef4347 (patch) | |
| tree | 1253b75aef5bff18d27cf619508bfe5068ff0fcc /eval.c | |
| parent | df7827a3e0dfc59a94c88b0eec916a1c37ba575b (diff) | |
| download | ruby-b5bfebe4203257227713d08897529a60a6ef4347.tar.gz ruby-b5bfebe4203257227713d08897529a60a6ef4347.tar.xz ruby-b5bfebe4203257227713d08897529a60a6ef4347.zip | |
* 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: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@9491 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'eval.c')
| -rw-r--r-- | eval.c | 15 |
1 files changed, 10 insertions, 5 deletions
@@ -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); } |
