Skip to content
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

Fix jump target in 3.12 if there are CACHE entries #1669

Closed
wants to merge 0 commits into from

Conversation

copybara-service[bot]
Copy link

Fix jump target in 3.12 if there are CACHE entries

Python 3.12 made the following changes to relative jumps (quoting https://docs.python.org/3.12/library/dis.html):

The argument of a jump is the offset of the target instruction relative to the instruction that appears immediately after the jump instruction’s CACHE entries.

The number of CACHE entries is fixed per opcode. E.g. in 3.12 the LOAD_GLOBAL opcode is always followed by 4 CACHE entries. This change adds a mapping Python version & opcode and the number of CACHE entries and adjusts the jump target (op.argval) accordingly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

0 participants