diff options
author | Irit Katriel <1055913+iritkatriel@users.noreply.github.com> | 2023-05-05 10:34:13 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-05 10:34:13 (GMT) |
commit | 81fc135f263e9ec5df3d967290b9665d7e100c7f (patch) | |
tree | a5024427a728a0f4e3879b2d7441c1e35dccf008 /Modules | |
parent | 163034515a81f137d1dd7d289dc048eb0f1cd424 (diff) | |
download | cpython-81fc135f263e9ec5df3d967290b9665d7e100c7f.zip cpython-81fc135f263e9ec5df3d967290b9665d7e100c7f.tar.gz cpython-81fc135f263e9ec5df3d967290b9665d7e100c7f.tar.bz2 |
gh-104051: fix crash in test_xxtestfuzz with -We (#104052)
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/_xxtestfuzz/fuzzer.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/Modules/_xxtestfuzz/fuzzer.c b/Modules/_xxtestfuzz/fuzzer.c index fb0c191..37d4028 100644 --- a/Modules/_xxtestfuzz/fuzzer.c +++ b/Modules/_xxtestfuzz/fuzzer.c @@ -526,13 +526,20 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { #if !defined(_Py_FUZZ_ONE) || defined(_Py_FUZZ_fuzz_sre_compile) static int SRE_COMPILE_INITIALIZED = 0; if (!SRE_COMPILE_INITIALIZED && !init_sre_compile()) { - PyErr_Print(); - abort(); + if (!PyErr_ExceptionMatches(PyExc_DeprecationWarning)) { + PyErr_Print(); + abort(); + } + else { + PyErr_Clear(); + } } else { SRE_COMPILE_INITIALIZED = 1; } - rv |= _run_fuzz(data, size, fuzz_sre_compile); + if (SRE_COMPILE_INITIALIZED) { + rv |= _run_fuzz(data, size, fuzz_sre_compile); + } #endif #if !defined(_Py_FUZZ_ONE) || defined(_Py_FUZZ_fuzz_sre_match) static int SRE_MATCH_INITIALIZED = 0; |