File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -342,9 +342,20 @@ void gc_collect_start(void) {
342
342
#endif
343
343
}
344
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
+ #ifdef __GNUC__
350
+ __attribute__((no_sanitize_address ))
351
+ #endif
352
+ static void * gc_get_ptr (void * * ptrs , int i ) {
353
+ return ptrs [i ];
354
+ }
355
+
345
356
void gc_collect_root (void * * ptrs , size_t len ) {
346
357
for (size_t i = 0 ; i < len ; i ++ ) {
347
- void * ptr = ptrs [ i ] ;
358
+ void * ptr = gc_get_ptr ( ptrs , i ) ;
348
359
if (VERIFY_PTR (ptr )) {
349
360
size_t block = BLOCK_FROM_PTR (ptr );
350
361
if (ATB_GET_KIND (block ) == AT_HEAD ) {
You can’t perform that action at this time.
0 commit comments