summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--thread.c6
2 files changed, 9 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index badd4d21ce..467bc2fba7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -4,6 +4,11 @@ Wed May 7 20:19:18 2008 NAKAMURA Usaku <usa@ruby-lang.org>
after Init_prelude() because cannot load encoding extensions before
it.
+Wed May 7 19:35:29 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
+
+ * thread.c (rb_thread_key_p): should always convert symbol to ID.
+ [ruby-dev:34588]
+
Wed May 7 19:30:34 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
* numeric.c (fix_divide): float division should floor() before
diff --git a/thread.c b/thread.c
index f0f2dce870..79c47b0f10 100644
--- a/thread.c
+++ b/thread.c
@@ -1557,15 +1557,17 @@ rb_thread_aset(VALUE self, ID id, VALUE val)
*/
static VALUE
-rb_thread_key_p(VALUE self, ID id)
+rb_thread_key_p(VALUE self, VALUE key)
{
rb_thread_t *th;
+ ID id = rb_to_id(key);
+
GetThreadPtr(self, th);
if (!th->local_storage) {
return Qfalse;
}
- if (st_lookup(th->local_storage, rb_to_id(id), 0)) {
+ if (st_lookup(th->local_storage, key, 0)) {
return Qtrue;
}
return Qfalse;