From 98ad27497471cc85cb249ffd7693cd5547c886d5 Mon Sep 17 00:00:00 2001 From: matz Date: Wed, 7 May 2008 13:24:03 +0000 Subject: * thread.c (rb_thread_key_p): should always convert symbol to ID. [ruby-dev:34588] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16315 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- thread.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'thread.c') 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; -- cgit v1.2.3