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

bpo-46841: Add a _Py_SET_OPCODE macro #31780

Merged
merged 2 commits into from
Mar 12, 2022
Merged

Conversation

brandtbucher
Copy link
Member

@brandtbucher brandtbucher commented Mar 9, 2022

Now that we don't modify opargs anymore, this is a cleaner (and slighly more efficient) way of performing this common move.

https://bugs.python.org/issue46841

Include/cpython/code.h Outdated Show resolved Hide resolved
Copy link
Member

@markshannon markshannon left a comment

Choose a reason for hiding this comment

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

The C compiler is allowed to assume that for uint8_t *p1, _Py_CODEUNIT *p2, p1 and p2 don't alias. If you add the special char * cast, then it cannot make that (in this case false) assumption.

Include/cpython/code.h Outdated Show resolved Hide resolved
@bedevere-bot
Copy link

When you're done making the requested changes, leave the comment: I have made the requested changes; please review again.

@markshannon
Copy link
Member

LGTM, apart from the missing cast.

@brandtbucher brandtbucher merged commit a89c29f into python:main Mar 12, 2022
@brandtbucher brandtbucher deleted the set-opcode branch July 21, 2022 19:54
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.

5 participants