diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-03-13 09:12:05 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-03-13 09:12:05 +0000 |
commit | 16e804117ca644a2ab14ba639d9d0313ba64de87 (patch) | |
tree | 5ab757d2e470b684308d2bfe08b6436f19de834f /test/ruby | |
parent | 193321503804586ebf7da3ea1e00bcc109bc1968 (diff) | |
download | ruby-16e804117ca644a2ab14ba639d9d0313ba64de87.tar.gz |
string.c: $; is a GC-root
* string.c (Init_String): $; must be a GC-root, not to be
collected. [ruby-core:79582]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57958 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby')
-rw-r--r-- | test/ruby/test_string.rb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/ruby/test_string.rb b/test/ruby/test_string.rb index 39cfc9a220..7dbf27e552 100644 --- a/test/ruby/test_string.rb +++ b/test/ruby/test_string.rb @@ -1451,6 +1451,17 @@ CODE assert_raise_with_message(TypeError, /\$;/) { $; = [] } + + assert_separately([], "#{<<~"begin;"}\n#{<<~'end;'}") + bug = '[ruby-core:79582] $; must not be GCed' + begin; + $; = " " + $a = nil + alias $; $a + alias $-F $a + GC.start + assert_equal([], "".split, bug) + end; end def test_split_encoding |