Skip to content

Commit 89e6a34

Browse files
authored
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.
1 parent c00dcf0 commit 89e6a34

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Modules/_xxsubinterpretersmodule.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -481,7 +481,7 @@ _run_script_in_interpreter(PyObject *mod, PyInterpreterState *interp,
481481
}
482482

483483
// Run the script.
484-
_sharedexception exc;
484+
_sharedexception exc = {NULL, NULL};
485485
int result = _run_script(interp, codestr, shared, &exc);
486486

487487
// Switch back.

0 commit comments

Comments
 (0)