Add a missing asan_unpoisoning_p in gc_set_candidate_object_i
It walks the heap, and checks for T_NONE and T_ZOMBIE objects, so it needs to unpoison these slots before accessing them when ASAN is enabled.
This commit is contained in:
parent
75234beb24
commit
dc9d2455b6
26
gc.c
26
gc.c
@ -9362,18 +9362,20 @@ gc_set_candidate_object_i(void *vstart, void *vend, size_t stride, void *data)
|
|||||||
rb_objspace_t *objspace = &rb_objspace;
|
rb_objspace_t *objspace = &rb_objspace;
|
||||||
VALUE v = (VALUE)vstart;
|
VALUE v = (VALUE)vstart;
|
||||||
for (; v != (VALUE)vend; v += stride) {
|
for (; v != (VALUE)vend; v += stride) {
|
||||||
switch (BUILTIN_TYPE(v)) {
|
asan_unpoisoning_object(v) {
|
||||||
case T_NONE:
|
switch (BUILTIN_TYPE(v)) {
|
||||||
case T_ZOMBIE:
|
case T_NONE:
|
||||||
break;
|
case T_ZOMBIE:
|
||||||
case T_STRING:
|
break;
|
||||||
// precompute the string coderange. This both save time for when it will be
|
case T_STRING:
|
||||||
// eventually needed, and avoid mutating heap pages after a potential fork.
|
// precompute the string coderange. This both save time for when it will be
|
||||||
rb_enc_str_coderange(v);
|
// eventually needed, and avoid mutating heap pages after a potential fork.
|
||||||
// fall through
|
rb_enc_str_coderange(v);
|
||||||
default:
|
// fall through
|
||||||
if (!RVALUE_OLD_P(v) && !RVALUE_WB_UNPROTECTED(v)) {
|
default:
|
||||||
RVALUE_AGE_SET_CANDIDATE(objspace, v);
|
if (!RVALUE_OLD_P(v) && !RVALUE_WB_UNPROTECTED(v)) {
|
||||||
|
RVALUE_AGE_SET_CANDIDATE(objspace, v);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user