-
-
Notifications
You must be signed in to change notification settings - Fork 32k
[3.13] gh-133441: Fix STORE_ATTR_WITH_HINT bytecode #133446
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Deoptimize if the dict is a dict subclass.
It looks like the offending code is on main as well. |
I failed to write code to trigger the bug on main, so I'm not sure that main is affected. |
Lib/test/test_dict.py
Outdated
@@ -1594,6 +1594,24 @@ def make_pairs(): | |||
self.assertEqual(d.get(key3_3), 44) | |||
self.assertGreaterEqual(eq_count, 1) | |||
|
|||
def test_store_attr_with_hint(self): | |||
# gh-133441: Regression test for STORE_ATTR_WITH_HINT bytecode |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be in test_opcache
not test_dict
IMO.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I moved the test to test_opcache, but I'm not sure if TestInstanceDict is a good home for such test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
@Fidget-Spinner: Do you think that the main branch is also affected? I'm unable to trigger the bug in the main branch, but the code looks the same. I would prefer to not deoptimize just for an hypothetical case if it cannot occur in practice. The code in the main branch is a little bit different. |
@vstinner did you try wrapping the repro in a loop? Sometimes that might trigger it. I mean an actual Python for loop, not |
I just tried to put the reproducer in a loop: I still cannot reproduce the failure on the main branch. |
Misc/NEWS.d/next/Core_and_Builtins/2025-05-05-17-02-08.gh-issue-133441.EpjHD4.rst
Outdated
Show resolved
Hide resolved
…e-133441.EpjHD4.rst Co-authored-by: Peter Bierma <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM as well. If 3.14 and 3.15 aren't affected, someone should add the test case.
Merged, thanks. |
Deoptimize if the dict is a dict subclass.
_PyEval_EvalFrameDefault
#133441