Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

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

Provide feedback

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

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

gh-134889: Fix handling of a few opcodes when optimizingLOAD_FAST#134958

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Draft
mpage wants to merge7 commits intopython:main
base:main
Choose a base branch
Loading
frommpage:gh-134889-fix-format-simple

Conversation

mpage
Copy link
Contributor

@mpagempage commentedMay 31, 2025
edited by bedevere-appbot
Loading

We were incorrectly handling a few opcodes that leave their operands on the stack. Treat all of these conservatively; assume that they always leave operands on the stack.

  • FORMAT_SIMPLE leaves its operand on the stack if its a unicode object.
  • GET_YIELD_FROM_ITER leaves its operand on the stack if its a coroutine or generator object.
  • END_SEND leaves the TOS in place.
  • SET_FUNCTION_ATTRIBUTE leaves the TOS in place.
  • PUSH_EXC_INFO leaves the TOS in place.
  • LOAD_SPECIAL may leave the TOS (self) in place.

Zheaoli reacted with thumbs up emoji
`FORMAT_SIMPLE` leaves its operand on the stack if its a unicode object.Since we cannot determine that at analysis (compile) time, treat itconservatively and assume it always leaves the operand on the stack.
It leaves the function on the stack
`GET_YIELD_FROM_ITER` doesn't consume its operand if its a coroutineor generator, so treat it conservatively.`END_SEND` leaves the TOS.
It leaves the TOS in place.
Load special may leave `self` on TOS. Treat it conservatively andassume it always does.
@mgorny
Copy link
Contributor

I suppose this means Python 3.14 is going to see an ABI breakage too, is that correct?

@mpage
Copy link
ContributorAuthor

I suppose this means Python 3.14 is going to see an ABI breakage too, is that correct?

I don’t think so. This doesn’t change the binary layout of anything. What about this would cause an ABI breakage?

@thesamesam
Copy link
Contributor

It changedPYC_MAGIC_NUMBER (which is fine if it can't be avoided, it's just a pain if it can be).

@mpage
Copy link
ContributorAuthor

It changed PYC_MAGIC_NUMBER (which is fine if it can't be avoided, it's just a pain if it can be).

I think I’m missing something. The magic number changes with every minor release. Since we haven’t released 3.14 yet, bumping the magic number shouldn’t cause any additional pain beyond what’s felt with a normal release.

@mgorny
Copy link
Contributor

A few Linux distributions have already engaged in a lot of Python 3.14 testing (at least Fedora and Gentoo I'm aware of), and these systems will be affected by the magic number change.

mpage and frenzymadness reacted with thumbs up emoji

@hroncok
Copy link
Contributor

In Fedora, we can deal with the chnage of the magic number in b3. But the sooner it happens the better.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@markshannonmarkshannonAwaiting requested review from markshannonmarkshannon will be requested when the pull request is marked ready for reviewmarkshannon is a code owner

@iritkatrieliritkatrielAwaiting requested review from iritkatrieliritkatriel will be requested when the pull request is marked ready for reviewiritkatriel is a code owner

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

4 participants
@mpage@mgorny@thesamesam@hroncok

[8]ページ先頭

©2009-2025 Movatter.jp