-
-
Notifications
You must be signed in to change notification settings - Fork 31.9k
Restrict co_code to be under INT_MAX in codeobject #20628
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
86b915b
to
265f962
Compare
Thanks for the fix :-) |
It needs to be backported to 3.9. See bpo-43499. |
Thanks @ammaraskar for the PR, and @pablogsal for merging it 🌮🎉.. I'm working now to backport this PR to: 3.9. |
Sorry, @ammaraskar and @pablogsal, I could not cleanly backport this to |
(cherry picked from commit 3b3b83c)
GH-24896 is a backport of this pull request to the 3.9 branch. |
Based on @vstinner's advice from #20590 (comment)
This assumption already exists in the interpreter: https://github.com/python/cpython/blob/master/Python/ceval.c#L1328
I checked
PyBytes_GET_SIZE(x)
directly instead ofPyBytes_GET_SIZE(x)/sizeof(_Py_CODEUNIT)
just like ceval, since presumably the smallest size of 1 for_Py_CODEUNIT
would still allowco_code
to be fully indexable with an int.