summaryrefslogtreecommitdiff
path: root/gc.c
diff options
context:
space:
mode:
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);
}