summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornagachika <nagachika@ruby-lang.org>2025-10-18 11:20:54 +0900
committernagachika <nagachika@ruby-lang.org>2025-10-18 11:20:54 +0900
commite526fbe770909974f610b7a2a00bd8d5dd045f1f (patch)
treed10920b70e1be7c0cc8a35813339029cc6b8b620
parenta4ca3de38e8910d7fc8968036157c08cb2604af5 (diff)
merge revision(s) e94a2f691d67ad98be9036e76c765fcfa7d22552: [Backport #21638]
[PATCH] [Bug #21638] Mark ractor-local `$VERBOSE` and `$DEBUG` https://github.com/sampersand/blog/blob/master/the%20-s%20flag.md#the-segfault
-rw-r--r--ractor.c2
-rw-r--r--test/ruby/test_rubyoptions.rb2
-rw-r--r--version.h2
3 files changed, 5 insertions, 1 deletions
diff --git a/ractor.c b/ractor.c
index 5bf84c7c83..7d50c81086 100644
--- a/ractor.c
+++ b/ractor.c
@@ -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) {
diff --git a/test/ruby/test_rubyoptions.rb b/test/ruby/test_rubyoptions.rb
index b256a70ba3..c0da5f63d3 100644
--- a/test/ruby/test_rubyoptions.rb
+++ b/test/ruby/test_rubyoptions.rb
@@ -560,6 +560,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_assignment_in_conditional
diff --git a/version.h b/version.h
index e2eacfaea4..ac60c5b888 100644
--- a/version.h
+++ b/version.h
@@ -11,7 +11,7 @@
# define RUBY_VERSION_MINOR RUBY_API_VERSION_MINOR
#define RUBY_VERSION_TEENY 9
#define RUBY_RELEASE_DATE RUBY_RELEASE_YEAR_STR"-"RUBY_RELEASE_MONTH_STR"-"RUBY_RELEASE_DAY_STR
-#define RUBY_PATCHLEVEL 180
+#define RUBY_PATCHLEVEL 181
#include "ruby/version.h"
#include "ruby/internal/abi.h"