ruby-changes:9583
From: yugui <ko1@a...>
Date: Sun, 28 Dec 2008 18:41:54 +0900 (JST)
Subject: [ruby-changes:9583] Ruby:r21123 (ruby_1_9_1): merges r21093 from trunk into ruby_1_9_1.
yugui 2008-12-28 18:41:34 +0900 (Sun, 28 Dec 2008) New Revision: 21123 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=21123 Log: merges r21093 from trunk into ruby_1_9_1. * 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(). Modified files: branches/ruby_1_9_1/ChangeLog branches/ruby_1_9_1/eval.c Index: ruby_1_9_1/ChangeLog =================================================================== --- ruby_1_9_1/ChangeLog (revision 21122) +++ ruby_1_9_1/ChangeLog (revision 21123) @@ -1,3 +1,13 @@ +Sat Dec 27 16:18:02 2008 Koichi Sasada <ko1@a...> + + * 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 <akr@f...> * transcode.c (make_econv_exception): show source and destination Index: ruby_1_9_1/eval.c =================================================================== --- ruby_1_9_1/eval.c (revision 21122) +++ ruby_1_9_1/eval.c (revision 21123) @@ -750,6 +750,12 @@ 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); /* check if prev_cfp can be accessible */ @@ -1106,7 +1112,7 @@ 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); -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/