Skip to content

gh-148210: fix incorrect _BINARY_OP_SUBSCR_DICT JIT optimization #148213

Merged
Fidget-Spinner merged 2 commits intopython:mainfrom
kumaraditya303:dict-opt-bug
Apr 8, 2026
Merged

gh-148210: fix incorrect _BINARY_OP_SUBSCR_DICT JIT optimization #148213
Fidget-Spinner merged 2 commits intopython:mainfrom
kumaraditya303:dict-opt-bug

Conversation

@kumaraditya303
Copy link
Copy Markdown
Contributor

@kumaraditya303 kumaraditya303 commented Apr 7, 2026

Copy link
Copy Markdown
Member

@corona10 corona10 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

@markshannon
Copy link
Copy Markdown
Member

markshannon commented Apr 7, 2026

The fix looks correct, but can we have a test?
This crashes on main:

>>> f = frozendict({"a":1})
>>> def test():
...     for _ in range(10_000):
...         f["a"]
>>> test()
Segmentation fault (core dumped)

@kumaraditya303
Copy link
Copy Markdown
Contributor Author

The fix looks correct, but can we have a test?

Thanks for the reproducer, I added a test based on it.

@Fidget-Spinner Fidget-Spinner merged commit 6e08161 into python:main Apr 8, 2026
69 checks passed
@kumaraditya303 kumaraditya303 deleted the dict-opt-bug branch April 8, 2026 15:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants