Blob Blame History Raw
From 428791543be9e13af9426970f5796f3157dd30a0 Mon Sep 17 00:00:00 2001
From: nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>
Date: Tue, 9 Dec 2014 01:16:27 +0000
Subject: [PATCH] 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
---
 ChangeLog                     | 10 ++++++++++
 eval.c                        | 13 +++++++++++++
 test/ruby/test_objectspace.rb |  7 +++++++
 thread.c                      |  5 ++++-
 4 files changed, 34 insertions(+), 1 deletion(-)

diff --git a/thread.c b/thread.c
index 25cc214..360c6cb 100644
--- a/thread.c
+++ b/thread.c
@@ -4671,6 +4671,8 @@ threadptr_recursive_hash_set(rb_thread_t *th, VALUE hash)
 /* variables for recursive traversals */
 static ID recursive_key;
 
+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