From aebfdbeea573c031ea690ee93f816a53ac27ca51 Mon Sep 17 00:00:00 2001 From: ko1 Date: Sat, 27 Dec 2008 07:22:01 +0000 Subject: [PATCH] * eval.c (rb_frame_callee, rb_frame_caller): rb_frame_callee() should return method id on current frame. add rb_frame_caller() to get method id on parent frame. Bug #884 [ruby-dev:37446] * eval.c (rb_f_method_name): use rb_frame_caller() instead of rb_frame_callee(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21093 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 10 ++++++++++ eval.c | 8 +++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index e50f7b2c74..934878099c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +Sat Dec 27 16:18:02 2008 Koichi Sasada + + * eval.c (rb_frame_callee, rb_frame_caller): rb_frame_callee() + should return method id on current frame. + add rb_frame_caller() to get method id on parent frame. + Bug #884 [ruby-dev:37446] + + * eval.c (rb_f_method_name): use rb_frame_caller() + instead of rb_frame_callee(). + Sat Dec 27 15:28:12 2008 Tanaka Akira * transcode.c (make_econv_exception): show source and destination diff --git a/eval.c b/eval.c index 74489d3a65..6728703bbf 100644 --- a/eval.c +++ b/eval.c @@ -749,6 +749,12 @@ rb_frame_this_func(void) ID rb_frame_callee(void) +{ + return frame_func_id(GET_THREAD()->cfp); +} + +static ID +rb_frame_caller(void) { rb_thread_t *th = GET_THREAD(); rb_control_frame_t *prev_cfp = RUBY_VM_PREVIOUS_CONTROL_FRAME(th->cfp); @@ -1106,7 +1112,7 @@ rb_f_local_variables(void) static VALUE rb_f_method_name(void) { - ID fname = rb_frame_callee(); + ID fname = rb_frame_caller(); /* need *caller* ID */ if (fname) { return ID2SYM(fname);