diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-12-29 02:18:20 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-12-29 02:18:20 +0000 |
commit | 401c8bb00be23a6485a068add70e01419673a91e (patch) | |
tree | 695e66395b494972a653d54dfbfbc29903fbc110 /thread.c | |
parent | 7fd45e90cb165ae1274f8bdd10c76ef8cfab580b (diff) | |
download | ruby-401c8bb00be23a6485a068add70e01419673a91e.tar.gz |
thread.c: fix dynamic symbol keys
* thread.c (rb_thread_variable_get): fix dynamic symbol keys.
rb_check_id() returns non-zero only for static symbols, whereas
thread local variable keys can be dynamic symbols.
[ruby-core:67185] [Bug #10667]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49055 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'thread.c')
-rw-r--r-- | thread.c | 4 |
1 files changed, 1 insertions, 3 deletions
@@ -2936,11 +2936,9 @@ static VALUE rb_thread_variable_get(VALUE thread, VALUE key) { VALUE locals; - ID id = rb_check_id(&key); - if (!id) return Qnil; locals = rb_ivar_get(thread, id_locals); - return rb_hash_aref(locals, ID2SYM(id)); + return rb_hash_aref(locals, rb_to_symbol(key)); } /* |