Skip to content

Commit 7af9705

Browse files
nobuXrXr
authored andcommitted
[Backport #21638] Mark ractor-local $VERBOSE and $DEBUG
https://github.com/sampersand/blog/blob/master/the%20-s%20flag.md#the-segfault
1 parent c26a2b1 commit 7af9705

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

ractor.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,8 @@ ractor_mark(void *ptr)
217217
rb_gc_mark(r->r_stdin);
218218
rb_gc_mark(r->r_stdout);
219219
rb_gc_mark(r->r_stderr);
220+
rb_gc_mark(r->verbose);
221+
rb_gc_mark(r->debug);
220222
rb_hook_list_mark(&r->pub.hooks);
221223

222224
if (r->threads.cnt > 0) {

test/ruby/test_rubyoptions.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -573,6 +573,8 @@ def test_sflag
573573

574574
assert_in_out_err(%w(- -#=foo), "#!ruby -s\n", [],
575575
/invalid name for global variable - -# \(NameError\)/)
576+
577+
assert_in_out_err(['-s', '-e', 'GC.start; p $DEBUG', '--', '-DEBUG=x'], "", ['"x"'])
576578
end
577579

578580
def test_option_missing_argument

0 commit comments

Comments
 (0)