diff options
author | Aaron Patterson <tenderlove@ruby-lang.org> | 2020-09-25 15:01:23 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2020-09-28 08:20:23 -0700 |
commit | b9488accf9e2cbf5f7c47b42b3eb23469f0aa58d (patch) | |
tree | d7c1cf60907100f903c06ff12e2918b77b9961db /ext | |
parent | b328b830264408b467a5c904a474e7112c5d678c (diff) | |
download | ruby-b9488accf9e2cbf5f7c47b42b3eb23469f0aa58d.tar.gz |
Fix ASAN support when invalidating CCs
Again, this code is walking the heap. Empty slots can be poisoned, so
we need to unpoison before checking the type
Diffstat (limited to 'ext')
-rw-r--r-- | ext/objspace/objspace.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/ext/objspace/objspace.c b/ext/objspace/objspace.c index 074dfbdc95..d35bd80b7b 100644 --- a/ext/objspace/objspace.c +++ b/ext/objspace/objspace.c @@ -59,7 +59,7 @@ total_i(void *vstart, void *vend, size_t stride, void *ptr) struct total_data *data = (struct total_data *)ptr; for (v = (VALUE)vstart; v != (VALUE)vend; v += stride) { - void *ptr = asan_poisoned_object_p(v); + void *poisoned = asan_poisoned_object_p(v); asan_unpoison_object(v, false); if (RBASIC(v)->flags) { @@ -77,7 +77,7 @@ total_i(void *vstart, void *vend, size_t stride, void *ptr) } } - if (ptr) { + if (poisoned) { asan_poison_object(v); } } |