1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* 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
This commit is contained in:
matz 2008-05-07 13:24:03 +00:00
parent 274c6471b8
commit 98ad274974
2 changed files with 9 additions and 2 deletions

View file

@ -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 after Init_prelude() because cannot load encoding extensions before
it. 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> Wed May 7 19:30:34 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
* numeric.c (fix_divide): float division should floor() before * numeric.c (fix_divide): float division should floor() before

View file

@ -1557,15 +1557,17 @@ rb_thread_aset(VALUE self, ID id, VALUE val)
*/ */
static VALUE static VALUE
rb_thread_key_p(VALUE self, ID id) rb_thread_key_p(VALUE self, VALUE key)
{ {
rb_thread_t *th; rb_thread_t *th;
ID id = rb_to_id(key);
GetThreadPtr(self, th); GetThreadPtr(self, th);
if (!th->local_storage) { if (!th->local_storage) {
return Qfalse; return Qfalse;
} }
if (st_lookup(th->local_storage, rb_to_id(id), 0)) { if (st_lookup(th->local_storage, key, 0)) {
return Qtrue; return Qtrue;
} }
return Qfalse; return Qfalse;