diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-12-09 01:16:27 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-12-09 01:16:27 +0000 |
commit | 428791543be9e13af9426970f5796f3157dd30a0 (patch) | |
tree | 7f6c4c1af36ec40f480e32414456bb100b322266 /eval.c | |
parent | 1b13e1e6984713db91e616506f1167debbc1e79f (diff) | |
download | ruby-428791543be9e13af9426970f5796f3157dd30a0.tar.gz |
thread.c: get rid of invalid ID symbol
* 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]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48744 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'eval.c')
-rw-r--r-- | eval.c | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -1030,6 +1030,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 |