From: Sam Gross Date: Sat, 20 Dec 2025 19:42:12 +0000 (-0500) Subject: gh-120321: Avoid `-Wunreachable-code` warning on Clang (gh-143022) X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7607712b61b7ab35c08e189155c0e161f9ad74b0;p=thirdparty%2FPython%2Fcpython.git gh-120321: Avoid `-Wunreachable-code` warning on Clang (gh-143022) --- diff --git a/Objects/genobject.c b/Objects/genobject.c index 1e59d89f5ce8..020af903a3f8 100644 --- a/Objects/genobject.c +++ b/Objects/genobject.c @@ -422,7 +422,8 @@ gen_close(PyObject *self, PyObject *args) int8_t frame_state = FT_ATOMIC_LOAD_INT8_RELAXED(gen->gi_frame_state); do { if (frame_state == FRAME_CREATED) { - if (!_Py_GEN_TRY_SET_FRAME_STATE(gen, frame_state, FRAME_CLEARED)) { + // && (1) to avoid -Wunreachable-code warning on Clang + if (!_Py_GEN_TRY_SET_FRAME_STATE(gen, frame_state, FRAME_CLEARED) && (1)) { continue; } gen_clear_frame(gen);