]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-120321: Add missing "return false" in gen_try_set_executing (gh-144291)
authorSam Gross <colesbury@gmail.com>
Tue, 27 Jan 2026 21:38:50 +0000 (16:38 -0500)
committerGitHub <noreply@github.com>
Tue, 27 Jan 2026 21:38:50 +0000 (16:38 -0500)
We didn't catch this because of a combination of:

1) falling through to the if-statement below works
2) we only specialized FOR_ITER_GEN for uniquely referenced generators,
   so we didn't trigger the non-thread-safe behavior.

Python/ceval_macros.h

index d791ba0e8eca97eb2a9688f0e9b802284bcc7d62..79ec80329165dd9988a31a1231be6d6864e223c2 100644 (file)
@@ -529,6 +529,7 @@ gen_try_set_executing(PyGenObject *gen)
                 return true;
             }
         }
+        return false;
     }
 #endif
     // Use faster non-atomic modifications in the GIL-enabled build and when