Fix a compiler warning in _xxsubinterpretermodule.c (#103245)

Fix a (correct) warning about potential uses of uninitialized memory in
_xxsubinterpreter. Unlike newly allocated PyObject structs or global
structs, stack-allocated structs are not initialised, and a few places in
the code expect the _sharedexception struct data to be either NULL or
initialised.
This commit is contained in:
T. Wouters 2023-04-04 16:51:30 +02:00 committed by GitHub
parent c00dcf0e38
commit 89e6a34461
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -481,7 +481,7 @@ _run_script_in_interpreter(PyObject *mod, PyInterpreterState *interp,
} }
// Run the script. // Run the script.
_sharedexception exc; _sharedexception exc = {NULL, NULL};
int result = _run_script(interp, codestr, shared, &exc); int result = _run_script(interp, codestr, shared, &exc);
// Switch back. // Switch back.