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-138250: load fast optimization should fall through to empty blocks #138249

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

Merged
DinoV merged 1 commit into python:main from DinoV:load_fast_fallthrough
Aug 29, 2025

Conversation

Copy link
Contributor

@DinoV DinoV commented Aug 29, 2025
edited by bedevere-app bot
Loading

In code like:

def x(tz_str):
 try:
 start, end = 1, 2
 except ValueError as e:
 raise Exception()
 return f(start, end)

The compiler ends up producing an empty basic block. When the load fast optimization runs it sees that term == NULL and doesn't fall through to the following block. The end result is that the compiler doesn't properly produce a LOAD_FAST_BORROWED_LOAD_FAST_BORROWED opcode.

The analysis should just use the BB_HAS_FALLTHROUGH macro instead of duplicating the logic.

@DinoV DinoV requested a review from mpage August 29, 2025 18:12
@DinoV DinoV changed the title (削除) load fast optimization should fall through to empty blocks (削除ここまで) (追記) gh-138250: load fast optimization should fall through to empty blocks (追記ここまで) Aug 29, 2025
@DinoV DinoV marked this pull request as ready for review August 29, 2025 18:41
Copy link
Contributor

@mpage mpage left a comment

Choose a reason for hiding this comment

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

LGTM - fixes a bug and is much cleaner!

@DinoV DinoV merged commit e05182f into python:main Aug 29, 2025
51 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Reviewers

@mpage mpage mpage approved these changes

@markshannon markshannon Awaiting requested review from markshannon markshannon is a code owner

@iritkatriel iritkatriel Awaiting requested review from iritkatriel iritkatriel is a code owner

Assignees
No one assigned
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants

AltStyle によって変換されたページ (->オリジナル) /