8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0e87459 commit 1ad94ddCopy full SHA for 1ad94dd
py/gc.c
@@ -342,9 +342,18 @@ void gc_collect_start(void) {
342
#endif
343
}
344
345
+// Address sanitizer needs to know that the access to ptrs[i] must
346
+// always be considered OK even if it's a load from an address that
347
+// would normally be prohibited (due to being undefined, in a red zone,
348
+// etc)
349
+__attribute__((no_sanitize_address))
350
+static void *gc_get_ptr(void **ptrs, int i) {
351
+ return ptrs[i];
352
+}
353
+
354
void gc_collect_root(void **ptrs, size_t len) {
355
for (size_t i = 0; i < len; i++) {
- void *ptr = ptrs[i];
356
+ void *ptr = gc_get_ptr(ptrs, i);
357
if (VERIFY_PTR(ptr)) {
358
size_t block = BLOCK_FROM_PTR(ptr);
359
if (ATB_GET_KIND(block) == AT_HEAD) {
0 commit comments