1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* 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
This commit is contained in:
matz 2005-11-01 13:45:00 +00:00
parent cdcfcef20f
commit 90509da425
3 changed files with 19 additions and 5 deletions

View file

@ -1,3 +1,11 @@
Tue Nov 1 14:20:11 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
* 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.
Tue Nov 01 10:50:17 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
* ext/openssl/extconf.rb: should check ERR_peek_last_error().

15
eval.c
View file

@ -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);
}

View file

@ -436,6 +436,7 @@ class RubyLex
def_exception(:SyntaxError, "%s")
include RubyToken
include IRB
attr_reader :continue
attr_reader :lex_state