summaryrefslogtreecommitdiff
path: root/vm.c
diff options
context:
space:
mode:
authorAlan Wu <XrXr@users.noreply.github.com>2019-05-30 23:16:27 -0400
committerNobuyoshi Nakada <nobu@ruby-lang.org>2019-05-31 14:38:35 +0900
commitea42423908ed055f9039b1dce6e9a232a3b2dd90 (patch)
treef6b404f83fa411b8e1ef696bead7beab8d331b02 /vm.c
parent83f9183a7e549b0d7e6b68e298d57744ddb4d97f (diff)
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]
Diffstat (limited to 'vm.c')
-rw-r--r--vm.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/vm.c b/vm.c
index 1bc1ed757f..9dd97e77c7 100644
--- a/vm.c
+++ b/vm.c
@@ -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);