diff options
-rw-r--r-- | test/ruby/test_process.rb | 8 | ||||
-rw-r--r-- | vm.c | 1 |
2 files changed, 9 insertions, 0 deletions
diff --git a/test/ruby/test_process.rb b/test/ruby/test_process.rb index ba7126912b..fb3f50a573 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") @@ -2248,6 +2248,7 @@ rb_vm_mark(void *ptr) rb_gc_mark(vm->loaded_features); rb_gc_mark(vm->loaded_features_snapshot); rb_gc_mark(vm->top_self); + rb_gc_mark(vm->orig_progname); RUBY_MARK_UNLESS_NULL(vm->coverages); /* Prevent classes from moving */ rb_mark_tbl(vm->defined_module_hash); |