summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2019-08-26 15:10:32 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2019-08-26 15:10:32 +0000
commit6e5e5df1bfd971687cb370c4f42226a5fc255dfc (patch)
tree854ff91628279842795fee523b83afa66f42be2e /test
parent522bc8ade996b59a0bfca85cf448a065a37a4777 (diff)
merge revision(s) ea42423908ed055f9039b1dce6e9a232a3b2dd90: [Backport #15887]
Keep vm->orig_progname alive `vm->orig_progname` can be different from `vm->progname` when user code assigns to `$0`. While `vm->progname` is kept alive by the global table, nothing marked `vm->orig_progname`. [Bug #15887] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_5@67761 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_process.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/ruby/test_process.rb b/test/ruby/test_process.rb
index eb114dbebb..ba7b0f1177 100644
--- a/test/ruby/test_process.rb
+++ b/test/ruby/test_process.rb
@@ -1373,6 +1373,14 @@ class TestProcess < Test::Unit::TestCase
}
end
+ def test_argv0_keep_alive
+ assert_in_out_err([], <<~REPRO, ['-'], [], "[Bug #15887]")
+ $0 = "diverge"
+ 4.times { GC.start }
+ puts Process.argv0
+ REPRO
+ end
+
def test_status
with_tmpchdir do
s = run_in_child("exit 1")