Skip to content

Commit 81fc135

Browse files
authored
gh-104051: fix crash in test_xxtestfuzz with -We (#104052)
1 parent 1630345 commit 81fc135

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

Modules/_xxtestfuzz/fuzzer.c

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -526,13 +526,20 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
526526
#if !defined(_Py_FUZZ_ONE) || defined(_Py_FUZZ_fuzz_sre_compile)
527527
static int SRE_COMPILE_INITIALIZED = 0;
528528
if (!SRE_COMPILE_INITIALIZED && !init_sre_compile()) {
529-
PyErr_Print();
530-
abort();
529+
if (!PyErr_ExceptionMatches(PyExc_DeprecationWarning)) {
530+
PyErr_Print();
531+
abort();
532+
}
533+
else {
534+
PyErr_Clear();
535+
}
531536
} else {
532537
SRE_COMPILE_INITIALIZED = 1;
533538
}
534539

535-
rv |= _run_fuzz(data, size, fuzz_sre_compile);
540+
if (SRE_COMPILE_INITIALIZED) {
541+
rv |= _run_fuzz(data, size, fuzz_sre_compile);
542+
}
536543
#endif
537544
#if !defined(_Py_FUZZ_ONE) || defined(_Py_FUZZ_fuzz_sre_match)
538545
static int SRE_MATCH_INITIALIZED = 0;

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy