mirror of
https://github.com/ruby/ruby.git
synced 2025-09-16 17:14:01 +02:00
merge revision(s) 49055: [Backport #10667]
* 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/branches/ruby_2_2@49125 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
017eb0f12c
commit
eb07614085
5 changed files with 28 additions and 7 deletions
4
thread.c
4
thread.c
|
@ -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));
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue