@@ -448,11 +448,12 @@ def skip_if_buildbot(reason=None):
448448 isbuildbot = False
449449 return unittest .skipIf (isbuildbot , reason )
450450
451- def check_sanitizer (* , address = False , memory = False , ub = False , thread = False ,
452- function = True ):
451+ def check_sanitizer (* , address = False , hwaddress = False , memory = False , ub = False ,
452+ thread = False , function = True ):
453453 """Returns True if Python is compiled with sanitizer support"""
454- if not (address or memory or ub or thread ):
455- raise ValueError ('At least one of address, memory, ub or thread must be True' )
454+ if not (address or hwaddress or memory or ub or thread ):
455+ raise ValueError ('At least one of address, hwaddress, memory, ub or '
456+ 'thread must be True' )
456457
457458
458459 cflags = sysconfig .get_config_var ('CFLAGS' ) or ''
@@ -461,9 +462,14 @@ def check_sanitizer(*, address=False, memory=False, ub=False, thread=False,
461462 '-fsanitize=memory' in cflags or
462463 '--with-memory-sanitizer' in config_args
463464 )
465+ hwaddress_sanitizer = (
466+ '-fsanitize=hwaddress' in cflags or
467+ '--with-hwaddress-sanitizer' in config_args
468+ )
464469 address_sanitizer = (
465470 '-fsanitize=address' in cflags or
466- '--with-address-sanitizer' in config_args
471+ '--with-address-sanitizer' in config_args or
472+ hwaddress_sanitizer
467473 )
468474 ub_sanitizer = (
469475 '-fsanitize=undefined' in cflags or
@@ -479,6 +485,7 @@ def check_sanitizer(*, address=False, memory=False, ub=False, thread=False,
479485 return (
480486 (memory and memory_sanitizer ) or
481487 (address and address_sanitizer ) or
488+ (hwaddress and hwaddress_sanitizer ) or
482489 (ub and ub_sanitizer ) or
483490 (thread and thread_sanitizer ) or
484491 (function and function_sanitizer )
0 commit comments