[Bug #21638] Mark ractor-local $VERBOSE and $DEBUG

https://github.com/sampersand/blog/blob/master/the%20-s%20flag.md#the-segfault
This commit is contained in:
Nobuyoshi Nakada 2025-10-14 12:38:52 +09:00
parent da3336c52b
commit e94a2f691d
No known key found for this signature in database
GPG Key ID: 3582D74E1FEE4465
Notes: git 2025-10-14 04:30:22 +00:00
2 changed files with 4 additions and 0 deletions

View File

@ -216,6 +216,8 @@ ractor_mark(void *ptr)
rb_gc_mark(r->r_stdin);
rb_gc_mark(r->r_stdout);
rb_gc_mark(r->r_stderr);
rb_gc_mark(r->verbose);
rb_gc_mark(r->debug);
rb_hook_list_mark(&r->pub.hooks);
if (r->threads.cnt > 0) {

View File

@ -530,6 +530,8 @@ class TestRubyOptions < Test::Unit::TestCase
assert_in_out_err(%w(- -#=foo), "#!ruby -s\n", [],
/invalid name for global variable - -# \(NameError\)/)
assert_in_out_err(['-s', '-e', 'GC.start; p $DEBUG', '--', '-DEBUG=x'], "", ['"x"'])
end
def test_option_missing_argument