diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-03-14 05:54:35 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-03-14 05:54:35 +0000 |
commit | 6f01a32d319bc1a57f445aef959449a05df71575 (patch) | |
tree | 6abb615150a089ed7073dd8cb1a1a1e4c2c0e10c /test | |
parent | 1e04081ddf3481f2f49d9ca865df8e382b47e23c (diff) | |
download | ruby-6f01a32d319bc1a57f445aef959449a05df71575.tar.gz |
thread.c: Thread.start with Symbol
* thread.c (thread_do_start): fix segfault at start with Symbol.
proc created by Symbol#to_proc does not have environment unless
using refinements. [ruby-core:80147] [Bug #13313]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57969 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_thread.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/test/ruby/test_thread.rb b/test/ruby/test_thread.rb index c82018dc8e..e9bf1f16b6 100644 --- a/test/ruby/test_thread.rb +++ b/test/ruby/test_thread.rb @@ -176,6 +176,14 @@ class TestThread < Test::Unit::TestCase t2.kill if t2 end + def test_new_symbol_proc + bug = '[ruby-core:80147] [Bug #13313]' + assert_ruby_status([], "#{<<-"begin;"}\n#{<<-'end;'}", bug) + begin; + exit("1" == Thread.start(1, &:to_s).value) + end; + end + def test_join t = Thread.new { sleep } assert_nil(t.join(0.05)) |