isbuildbot = False
return unittest.skipIf(isbuildbot, reason)
-def check_sanitizer(*, address=False, memory=False, ub=False, thread=False):
+def check_sanitizer(*, address=False, memory=False, ub=False, thread=False,
+ function=True):
"""Returns True if Python is compiled with sanitizer support"""
if not (address or memory or ub or thread):
raise ValueError('At least one of address, memory, ub or thread must be True')
'-fsanitize=thread' in cflags or
'--with-thread-sanitizer' in config_args
)
+ function_sanitizer = (
+ '-fsanitize=function' in cflags
+ )
return (
(memory and memory_sanitizer) or
(address and address_sanitizer) or
(ub and ub_sanitizer) or
- (thread and thread_sanitizer)
+ (thread and thread_sanitizer) or
+ (function and function_sanitizer)
)
if not support.has_subprocess_support:
raise unittest.SkipTest("test module requires subprocess")
-if support.check_sanitizer(address=True, memory=True, ub=True):
+if support.check_sanitizer(address=True, memory=True, ub=True, function=True):
# gh-109580: Skip the test because it does crash randomly if Python is
# built with ASAN.
raise unittest.SkipTest("test crash randomly on ASAN/MSAN/UBSAN build")