Skip to content

Commit 247b336

Browse files
Yhg1swarsaw
authored andcommitted
Fix a compiler warning in _xxsubinterpretermodule.c (python#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 dbbf2b0 commit 247b336

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Modules/_xxsubinterpretersmodule.c

Lines changed: 1 addition & 1 deletion
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)