summaryrefslogtreecommitdiff
path: root/ext/objspace
diff options
context:
space:
mode:
authorAaron Patterson <tenderlove@ruby-lang.org>2020-09-25 15:01:23 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2020-09-28 08:20:23 -0700
commitb9488accf9e2cbf5f7c47b42b3eb23469f0aa58d (patch)
treed7c1cf60907100f903c06ff12e2918b77b9961db /ext/objspace
parentb328b830264408b467a5c904a474e7112c5d678c (diff)
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
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/3592
Diffstat (limited to 'ext/objspace')
-rw-r--r--ext/objspace/objspace.c4
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);
}
}