mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Skip poisoned regions
Poisoned regions cannot be accessed without unpoisoning outside gc.c. Specifically, debug.gem is terminated by AddressSanitizer. ``` SUMMARY: AddressSanitizer: use-after-poison iseq_collector.c:39 in iseq_i ```
This commit is contained in:
parent
44264b4fee
commit
ff07e5c264
1 changed files with 2 additions and 1 deletions
3
gc.c
3
gc.c
|
@ -3904,7 +3904,8 @@ objspace_each_objects_try(VALUE arg)
|
||||||
uintptr_t pstart = (uintptr_t)page->start;
|
uintptr_t pstart = (uintptr_t)page->start;
|
||||||
uintptr_t pend = pstart + (page->total_slots * size_pool->slot_size);
|
uintptr_t pend = pstart + (page->total_slots * size_pool->slot_size);
|
||||||
|
|
||||||
if ((*data->callback)((void *)pstart, (void *)pend, size_pool->slot_size, data->data)) {
|
if (!__asan_region_is_poisoned((void *)pstart, pend - pstart) &&
|
||||||
|
(*data->callback)((void *)pstart, (void *)pend, size_pool->slot_size, data->data)) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue