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

* eval.c (rb_eval): [ruby-core:03856]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7421 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
matz 2004-11-30 04:01:17 +00:00
parent afae182fe2
commit 38ada9fe87
3 changed files with 7 additions and 2 deletions

View file

@ -1,5 +1,7 @@
Tue Nov 30 00:49:08 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
* eval.c (rb_eval): [ruby-core:03856]
* io.c (rb_io_sysread): use temporary lock. [ruby-dev:24992]
Tue Nov 30 00:12:57 2004 Kazuo Saito <ksaito@uranus.dti.ne.jp>

3
env.h
View file

@ -29,8 +29,7 @@ RUBY_EXTERN struct FRAME {
void rb_gc_mark_frame _((struct FRAME *));
#define FRAME_ALLOCA 0
#define FRAME_MALLOC 1
#define FRAME_DMETH 1
RUBY_EXTERN struct SCOPE {
struct RBasic super;

4
eval.c
View file

@ -3250,6 +3250,9 @@ rb_eval(self, n)
}
}
if (nd_type(node) == NODE_ZSUPER) {
if (ruby_frame->flags & FRAME_DMETH) {
rb_raise(rb_eRuntimeError, "super: specify arguments explicitly");
}
argc = ruby_frame->argc;
argv = ruby_scope->local_vars + 2;
}
@ -5550,6 +5553,7 @@ rb_call0(klass, recv, id, oid, argc, argv, body, nosuper)
break;
case NODE_BMETHOD:
ruby_frame->flags |= FRAME_DMETH;
result = proc_invoke(body->nd_cval, rb_ary_new4(argc, argv), recv, klass);
break;