◐ Shell
clean mode source ↗

bpo-46841: Add a `_Py_SET_OPCODE` macro by brandtbucher · Pull Request #31780 · python/cpython

Conversation

@brandtbucher

@brandtbucher brandtbucher commented

Mar 9, 2022

edited by bedevere-bot

Loading

Copy link Copy Markdown

Member

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

@markshannon markshannon left a comment

Copy link Copy Markdown

Member

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.

Comment thread

Include/cpython/code.h Outdated

@bedevere-bot

Copy link Copy Markdown

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

@markshannon

Copy link Copy Markdown

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

Reviewers

@markshannon markshannon markshannon requested changes

@sweeneyde sweeneyde sweeneyde left review comments

Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

5 participants

@brandtbucher @bedevere-bot @markshannon @sweeneyde @the-knights-who-say-ni