-
-
Notifications
You must be signed in to change notification settings - Fork 33.1k
Closed
Labels
3.14bugs and security fixesbugs and security fixesinterpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)topic-free-threadingtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Description
Bug report
Lines 843 to 855 in d95ba9f
#ifdef Py_GIL_DISABLED | |
/* Load thread-local bytecode */ | |
if (frame->tlbc_index != ((_PyThreadStateImpl *)tstate)->tlbc_index) { | |
_Py_CODEUNIT *bytecode = | |
_PyEval_GetExecutableCode(tstate, _PyFrame_GetCode(frame)); | |
if (bytecode == NULL) { | |
goto error; | |
} | |
ptrdiff_t off = frame->instr_ptr - _PyFrame_GetBytecode(frame); | |
frame->tlbc_index = ((_PyThreadStateImpl *)tstate)->tlbc_index; | |
frame->instr_ptr = bytecode + off; | |
} | |
#endif |
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
Linked PRs
Metadata
Metadata
Assignees
Labels
3.14bugs and security fixesbugs and security fixesinterpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)topic-free-threadingtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error