summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNobuyoshi Nakada <[email protected]>2024-08-09 21:43:32 +0900
committerNobuyoshi Nakada <[email protected]>2024-08-11 02:36:37 +0900
commit21a9d7664c9f612f71e2059a8b0a091a2cc5e46e (patch)
tree759d6667746bfee781d6619bf9bec3fb5caa4f34
parent04d57e2c5cab6d2875de9512aa04a141885b44d9 (diff)
Fix flag test macro
`RBOOL` is a macro to convert C boolean to Ruby boolean.
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/11351
-rw-r--r--gc/default.c2
-rw-r--r--test/ruby/test_gc.rb4
2 files changed, 4 insertions, 2 deletions
diff --git a/gc/default.c b/gc/default.c
index 5b7e427e3e..1ecffe9b1d 100644
--- a/gc/default.c
+++ b/gc/default.c
@@ -8035,7 +8035,7 @@ gc_config_set_key(st_data_t key, st_data_t value, st_data_t data)
rb_objspace_t *objspace = (rb_objspace_t *)data;
if (rb_sym2id(key) == rb_intern("rgengc_allow_full_mark")) {
gc_rest(objspace);
- gc_config_full_mark_set(RBOOL(value));
+ gc_config_full_mark_set(RTEST(value));
}
return ST_CONTINUE;
}
diff --git a/test/ruby/test_gc.rb b/test/ruby/test_gc.rb
index f47f1e282a..a05da28f7e 100644
--- a/test/ruby/test_gc.rb
+++ b/test/ruby/test_gc.rb
@@ -74,8 +74,10 @@ class TestGc < Test::Unit::TestCase
new_value = GC.config(rgengc_allow_full_mark: false)[:rgengc_allow_full_mark]
assert_false(new_value)
+ new_value = GC.config(rgengc_allow_full_mark: nil)[:rgengc_allow_full_mark]
+ assert_false(new_value)
ensure
- GC.config(rgengc_allow_full_mark: true)
+ GC.config(rgengc_allow_full_mark: old_value)
GC.start
end