From: T. Wouters Date: Tue, 4 Apr 2023 14:51:30 +0000 (+0200) Subject: Fix a compiler warning in _xxsubinterpretermodule.c (#103245) X-Git-Tag: v3.12.0a7~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=89e6a3446184925ee7f17cd0d948c7784a88b8d7;p=thirdparty%2FPython%2Fcpython.git 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. --- diff --git a/Modules/_xxsubinterpretersmodule.c b/Modules/_xxsubinterpretersmodule.c index 9648f080cd75..11164676c4d1 100644 --- a/Modules/_xxsubinterpretersmodule.c +++ b/Modules/_xxsubinterpretersmodule.c @@ -481,7 +481,7 @@ _run_script_in_interpreter(PyObject *mod, PyInterpreterState *interp, } // Run the script. - _sharedexception exc; + _sharedexception exc = {NULL, NULL}; int result = _run_script(interp, codestr, shared, &exc); // Switch back.