summaryrefslogtreecommitdiff
path: root/eval.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-07-26 02:26:08 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-07-26 02:26:08 +0000
commit34ca2ab05891c41e28deecde6a8548127f286525 (patch)
treefa18dbdc23917c331e91fdb7ae9b7f41e91a5867 /eval.c
parenteb51666a192204ea1689154404d03a03dc5a64de (diff)
* variable.c (rb_mod_const_missing): "const_missing" should not
appear in the caller(); add call frame adjustment. * eval.c (rb_method_missing): simplify call frame adjustment. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4168 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'eval.c')
-rw-r--r--eval.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/eval.c b/eval.c
index 4d0d57c..cf32ff2 100644
--- a/eval.c
+++ b/eval.c
@@ -4635,7 +4635,7 @@ static int last_call_status;
#define CSTAT_SUPER 8
static VALUE
-rb_f_missing(argc, argv, obj)
+rb_method_missing(argc, argv, obj)
int argc;
VALUE *argv;
VALUE obj;
@@ -4697,8 +4697,6 @@ rb_f_missing(argc, argv, obj)
}
ruby_current_node = cnode;
- PUSH_FRAME(); /* fake frame */
- *ruby_frame = *_frame.prev->prev;
{
char buf[BUFSIZ];
int noclass = (!desc || desc[0]=='#');
@@ -4714,9 +4712,9 @@ rb_f_missing(argc, argv, obj)
args[n++] = rb_ary_new4(argc-1, argv+1);
}
exc = rb_class_new_instance(n, args, exc);
+ ruby_frame = ruby_frame->prev; /* pop frame for "method_missing" */
rb_exc_raise(exc);
}
- POP_FRAME();
return Qnil; /* not reached */
}
@@ -4735,7 +4733,7 @@ method_missing(obj, id, argc, argv, call_status)
if (id == missing) {
PUSH_FRAME();
- rb_f_missing(argc, argv, obj);
+ rb_method_missing(argc, argv, obj);
POP_FRAME();
}
else if (id == ID_ALLOCATOR) {
@@ -6523,7 +6521,7 @@ Init_eval()
rb_define_global_function("eval", rb_f_eval, -1);
rb_define_global_function("iterator?", rb_f_block_given_p, 0);
rb_define_global_function("block_given?", rb_f_block_given_p, 0);
- rb_define_global_function("method_missing", rb_f_missing, -1);
+ rb_define_global_function("method_missing", rb_method_missing, -1);
rb_define_global_function("loop", rb_f_loop, 0);
rb_define_method(rb_mKernel, "respond_to?", rb_obj_respond_to, -1);