Uninitialized variable next_instr
in error code path #128955
Closed
Description
Bug report
Lines 843 to 855 in d95ba9f
Clang warns:
Python/ceval.c:848:17: warning: variable 'next_instr' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
848 | if (bytecode == NULL) {
| ^~~~~~~~~~~~~~~~
Python/ceval.c:957:45: note: uninitialized use occurs here
957 | _PyEval_MonitorRaise(tstate, frame, next_instr-1);
| ^~~~~~~~~~
Python/ceval.c:848:13: note: remove the 'if' if its condition is always false
848 | if (bytecode == NULL) {
| ^~~~~~~~~~~~~~~~~~~~~~~
849 | goto error;
| ~~~~~~~~~~~
850 | }
| ~
The warning looks legitimate to me. Nearby code mostly uses goto exit_unwind
. Maybe we should use that instead of goto error
?
cc @mpage