Skip to content

Commit 7607712

Browse files
authored
gh-120321: Avoid -Wunreachable-code warning on Clang (gh-143022)
1 parent 3cc5750 commit 7607712

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Objects/genobject.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,8 @@ gen_close(PyObject *self, PyObject *args)
422422
int8_t frame_state = FT_ATOMIC_LOAD_INT8_RELAXED(gen->gi_frame_state);
423423
do {
424424
if (frame_state == FRAME_CREATED) {
425-
if (!_Py_GEN_TRY_SET_FRAME_STATE(gen, frame_state, FRAME_CLEARED)) {
425+
// && (1) to avoid -Wunreachable-code warning on Clang
426+
if (!_Py_GEN_TRY_SET_FRAME_STATE(gen, frame_state, FRAME_CLEARED) && (1)) {
426427
continue;
427428
}
428429
gen_clear_frame(gen);

0 commit comments

Comments
 (0)