FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

gh-107901: Fix missing line number on BACKWARD_JUMP at the end of a for loop by iritkatriel · Pull Request #108242 · python/cpython · GitHub

/ cpython Public

gh-107901: Fix missing line number on BACKWARD_JUMP at the end of a for loop - #108242

Merged
iritkatriel merged 2 commits into
python:mainfrom
iritkatriel:gh-107901
Aug 21, 2023
Merged

iritkatriel merged 2 commits into
python:mainfrom
iritkatriel:gh-107901

Conversation

iritkatriel commented Aug 21, 2023
edited by bedevere-bot
Loading

Copy link
Copy Markdown
Member

iritkatriel requested a review from sweeneyde August 21, 2023 20:53
iritkatriel added type-bug An unexpected behavior, bug, or error 3.11 only security fixes 3.12 only security fixes 3.13 bugs and security fixes interpreter-core (Objects, Python, Grammar, and Parser dirs) labels Aug 21, 2023

sweeneyde 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

LGTM!

I'm not sure how to fix the other lineless instructions you mention, but I think this is a nice simple solution for this case.

iritkatriel changed the title gh-107901: Fix missing line number on :opcode:BACKWARD_JUMP at the end of a for loop gh-107901: Fix missing line number on BACKWARD_JUMP at the end of a for loop Aug 21, 2023
iritkatriel merged commit a1cc74c into python:main Aug 21, 2023
iritkatriel added needs backport to 3.11 only security fixes needs backport to 3.12 only security fixes labels Aug 22, 2023

Copy link
Copy Markdown
Contributor

Thanks @iritkatriel for the PR 🌮🎉.. I'm working now to backport this PR to: 3.11.
🐍🍒⛏🤖

Copy link
Copy Markdown
Contributor

Thanks @iritkatriel for the PR 🌮🎉.. I'm working now to backport this PR to: 3.12.
🐍🍒⛏🤖

Copy link
Copy Markdown
Contributor

Sorry, @iritkatriel, I could not cleanly backport this to 3.11 due to a conflict.
Please backport using cherry_picker on command line.
cherry_picker a1cc74c4eebc55795877eb3be019a1bec34402f8 3.11

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Aug 22, 2023
…of a for loop (pythonGH-108242)

(cherry picked from commit a1cc74c)

Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>

Copy link
Copy Markdown

GH-108275 is a backport of this pull request to the 3.12 branch.

bedevere-bot removed the needs backport to 3.12 only security fixes label Aug 22, 2023
iritkatriel removed 3.11 only security fixes 3.12 only security fixes 3.13 bugs and security fixes labels Aug 22, 2023
Comment thread Python/flowgraph.c
return ERROR;
}
basicblock_addop(backwards_jump, JUMP, target->b_label.id, NO_LOCATION);
basicblock_addop(backwards_jump, JUMP, target->b_label.id, last->i_loc);

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

This is the last physical location, not the last location executed. Won't it give the wrong line for the following?

ALWAYS_TRUE= True

def foo():
    while 1:
        if ALWAYS_TRUE:
            pass # last line executed
        else:
            pass # last physical line

iritkatriel Aug 22, 2023
edited
Loading

Copy link
Copy Markdown
Member Author

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

no, last is the conditional backwards jump that this jump is replacing (and which is replaced by a forward jump).

Yhg1s pushed a commit that referenced this pull request Aug 22, 2023
… of a for loop (GH-108242) (#108275)

gh-107901: Fix missing line number on BACKWARD_JUMP at the end of a for loop (GH-108242)
(cherry picked from commit a1cc74c)

Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
ZeroIntensity removed type-bug An unexpected behavior, bug, or error interpreter-core (Objects, Python, Grammar, and Parser dirs) needs backport to 3.11 only security fixes labels Feb 17, 2025
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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants


Back | FazBrowse Home | New Git URL