summaryrefslogtreecommitdiff
path: root/gc.c
diff options
context:
space:
mode:
authorPeter Zhu <[email protected]>2024-12-16 11:02:12 -0500
committerPeter Zhu <[email protected]>2024-12-16 13:32:35 -0500
commitd28368d27f6ee8e82dc293f10cbbcbe7f07fa9d1 (patch)
treed525be6182b54ff114ac1cc12bdc3b32102c1bec /gc.c
parentd0968b1b4c402a355f207db10abbb067ee3d3377 (diff)
Move special constant check in rb_gc_location to gc.c
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/12359
Diffstat (limited to 'gc.c')
-rw-r--r--gc.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/gc.c b/gc.c
index c5277ee2c8..dfef384eb3 100644
--- a/gc.c
+++ b/gc.c
@@ -3150,6 +3150,10 @@ check_id_table_move(VALUE value, void *data)
VALUE
rb_gc_location(VALUE value)
{
+ if (SPECIAL_CONST_P(value)) {
+ return value;
+ }
+
return rb_gc_impl_location(rb_gc_get_objspace(), value);
}