Move special constant check in rb_gc_location to gc.c
This commit is contained in:
parent
d0968b1b4c
commit
d28368d27f
Notes:
git
2024-12-16 18:32:54 +00:00
4
gc.c
4
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);
|
||||
}
|
||||
|
||||
|
@ -4012,19 +4012,14 @@ rb_gc_impl_location(void *objspace_ptr, VALUE value)
|
||||
{
|
||||
VALUE destination;
|
||||
|
||||
if (!SPECIAL_CONST_P(value)) {
|
||||
asan_unpoisoning_object(value) {
|
||||
if (BUILTIN_TYPE(value) == T_MOVED) {
|
||||
destination = (VALUE)RMOVED(value)->destination;
|
||||
GC_ASSERT(BUILTIN_TYPE(destination) != T_NONE);
|
||||
}
|
||||
else {
|
||||
destination = value;
|
||||
}
|
||||
asan_unpoisoning_object(value) {
|
||||
if (BUILTIN_TYPE(value) == T_MOVED) {
|
||||
destination = (VALUE)RMOVED(value)->destination;
|
||||
GC_ASSERT(BUILTIN_TYPE(destination) != T_NONE);
|
||||
}
|
||||
else {
|
||||
destination = value;
|
||||
}
|
||||
}
|
||||
else {
|
||||
destination = value;
|
||||
}
|
||||
|
||||
return destination;
|
||||
|
Loading…
x
Reference in New Issue
Block a user