]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Fix a compiler warning in _xxsubinterpretermodule.c (#103245)
authorT. Wouters <thomas@python.org>
Tue, 4 Apr 2023 14:51:30 +0000 (16:51 +0200)
committerGitHub <noreply@github.com>
Tue, 4 Apr 2023 14:51:30 +0000 (16:51 +0200)
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.

Modules/_xxsubinterpretersmodule.c

index 9648f080cd756ca8ab73c69be8e3f14d054c034e..11164676c4d10710fab30cc4d02b820aa933c925 100644 (file)
@@ -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.