summaryrefslogtreecommitdiff
path: root/thread.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-12-09 01:16:27 (GMT)
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-12-09 01:16:27 (GMT)
commit428791543be9e13af9426970f5796f3157dd30a0 (patch)
tree7f6c4c1af36ec40f480e32414456bb100b322266 /thread.c
parent1b13e1e6984713db91e616506f1167debbc1e79f (diff)
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 'thread.c')
-rw-r--r--thread.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/thread.c b/thread.c
index 25cc214..360c6cb 100644
--- a/thread.c
+++ b/thread.c
@@ -4696,6 +4696,8 @@ threadptr_recursive_hash_set(rb_thread_t *th, VALUE hash)
th->local_storage_recursive_hash = hash;
}
+ID rb_frame_last_func(void);
+
/*
* Returns the current "recursive list" used to detect recursion.
* This list is a hash table, unique for the current thread and for
@@ -4707,7 +4709,8 @@ recursive_list_access(void)
{
rb_thread_t *th = GET_THREAD();
VALUE hash = threadptr_recursive_hash(th);
- VALUE sym = ID2SYM(rb_frame_this_func());
+ ID mid = rb_frame_last_func();
+ VALUE sym = mid ? ID2SYM(mid) : ID2SYM(idNULL);
VALUE list;
if (NIL_P(hash) || !RB_TYPE_P(hash, T_HASH)) {
hash = ident_hash_new();