diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-07-19 03:16:58 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-07-19 03:16:58 +0000 |
commit | 73cdf5200203887ae45d250b17c299ff5c6e9696 (patch) | |
tree | 40e7cc264d6dc9425ebf9585c75346002c5b3ea6 /test/ruby/test_rand.rb | |
parent | a9a96f82b9cfce87f03dd1c48c070583812f4d52 (diff) | |
download | ruby-73cdf5200203887ae45d250b17c299ff5c6e9696.tar.gz |
random.c: ensure initialized
* random.c (get_rnd, try_get_rnd): ensure initialized to get rid
of crash in forked processes. [ruby-core:82100] [Bug #13753]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59368 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_rand.rb')
-rw-r--r-- | test/ruby/test_rand.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/test/ruby/test_rand.rb b/test/ruby/test_rand.rb index 7b4ae07ee9..af771a2a8f 100644 --- a/test/ruby/test_rand.rb +++ b/test/ruby/test_rand.rb @@ -464,6 +464,10 @@ END assert_fork_status(1, bug5661) {stable.rand(4)} r1, r2 = *assert_fork_status(2, bug5661) {stable.rand} assert_equal(r1, r2, bug5661) + + assert_fork_status(1, '[ruby-core:82100] [Bug #13753]') do + Random::DEFAULT.rand(4) + end rescue NotImplementedError end |