summaryrefslogtreecommitdiff
path: root/eval.c
diff options
context:
space:
mode:
authornagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-01-21 16:09:59 +0000
committernagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-01-21 16:09:59 +0000
commit4b0a168d7b82d7b9e50f61fe8d7a336dc8d84316 (patch)
tree9161530dc3e6a44a168286bfd8165682f49c491c /eval.c
parent83c5b533e36761141ed4dbd9db28e74520cb0ffd (diff)
merge revision(s) r48744,r48752: [Backport #10579]
* eval.c (rb_frame_last_func): return the most recent frame method name. * thread.c (recursive_list_access): use the last method name, instead of the current method name which can be unset in some cases, not to use a symbol by the invalid ID. [ruby-core:66742] [Bug #10579] * thread.c (exec_recursive): use the same last method name as recursive_push in the error message when recursive_pop failed. [ruby-core:66742] [Bug #10579] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_1@49369 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'eval.c')
-rw-r--r--eval.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/eval.c b/eval.c
index 7f002270a5..ed1eacead1 100644
--- a/eval.c
+++ b/eval.c
@@ -978,6 +978,19 @@ prev_frame_func(void)
return frame_func_id(prev_cfp);
}
+ID
+rb_frame_last_func(void)
+{
+ rb_thread_t *th = GET_THREAD();
+ rb_control_frame_t *cfp = th->cfp;
+ ID mid;
+
+ while (!(mid = frame_func_id(cfp)) &&
+ (cfp = RUBY_VM_PREVIOUS_CONTROL_FRAME(cfp),
+ !RUBY_VM_CONTROL_FRAME_STACK_OVERFLOW_P(th, cfp)));
+ return mid;
+}
+
/*
* call-seq:
* append_features(mod) -> mod