← 返回首页
bpo-46841: Add a `_Py_SET_OPCODE` macro by brandtbucher · Pull Request #31780 · python/cpython · GitHub
Skip to content

Navigation Menu

Toggle navigation
Sign in
Appearance settings
Search or jump to...

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Include my email address so I can be contacted

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Resetting focus

bpo-46841: Add a _Py_SET_OPCODE macro#31780

Merged
brandtbucher merged 2 commits into
python:mainfrom
brandtbucher:set-opcode
Mar 12, 2022
Merged

bpo-46841: Add a _Py_SET_OPCODE macro#31780
brandtbucher merged 2 commits into
python:mainfrom
brandtbucher:set-opcode

Conversation

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

Comment thread Include/cpython/code.h Outdated Show resolved Hide resolved

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.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality Hide comment

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 Show resolved Hide resolved

Copy link
Copy Markdown

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

Copy link
Copy Markdown
Member

LGTM, apart from the missing cast.

brandtbucher merged commit a89c29f into python:main Mar 12, 2022
brandtbucher deleted the set-opcode branch July 21, 2022 19:54
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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

Footer

© 2026 GitHub, Inc.