Skip to content

Commit

Permalink
pythongh-104051: fix crash in test_xxtestfuzz with -We (python#104052)
Browse files Browse the repository at this point in the history
  • Loading branch information
iritkatriel authored and jbower-fb committed May 8, 2023
1 parent 3205457 commit 4126669
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions Modules/_xxtestfuzz/fuzzer.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 4126669

Please sign in to comment.