gh-138349: Fix crash when combining module-level annotation and listcomp#138363
gh-138349: Fix crash when combining module-level annotation and listcomp#138363vstinner merged 3 commits intopython:mainfrom
Conversation
|
Do you need to bump the pyc magic number as well? I forgot whether bytecode invalidation matters here. |
|
The changes look correct to me, but I've not looked that closely at the conditional annotation code. |
@JelleZijlstra: Can you update the magic number (in |
|
Done |
vstinner
left a comment
There was a problem hiding this comment.
LGTM. The changes does fix the crash and the added tests check for non-regression.
|
Thanks @JelleZijlstra for the PR, and @vstinner for merging it 🌮🎉.. I'm working now to backport this PR to: 3.14. |
|
Sorry, @JelleZijlstra and @vstinner, I could not cleanly backport this to |
… listcomp (python#138363) (cherry picked from commit 7a6fd4a)
|
GH-138749 is a backport of this pull request to the 3.14 branch. |
|
Merged, thanks @JelleZijlstra. I wrote a backport to 3.14 (I adapted the magic number for 3.14). |
The bug was that we used the wrong name list to get
__conditional_annotations__, which caused us to emit a SET_ADD that was adding to something that wasn't a set. This manifested as a hang on debug builds and a crash on release builds for whatever reason, but the issue became more apparent when I added an assertion tosetobject.cto make sure we were only adding to sets.