summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authornagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2019-07-31 14:47:34 +0000
committernagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2019-07-31 14:47:34 +0000
commit86c338d6e5a9ce6b2c3c5ad0769020bc41952f73 (patch)
tree85f4fcd502974bad640b5ecf24425f54da473d92 /test
parent09b8eddcf238d795b96f15d21adcc6d9d51f7d71 (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_6@67721 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 7911a0cb20..b2f1ad7056 100644
--- a/test/ruby/test_process.rb
+++ b/test/ruby/test_process.rb
@@ -1400,6 +1400,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")