Uh oh!
There was an error while loading. Please reload this page.
gh-107901: Fix missing line number on BACKWARD_JUMP at the end of a for loop - #108242
Conversation
Uh oh!
There was an error while loading. Please reload this page.
sweeneyde
left a comment
There was a problem hiding this comment.
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.
BACKWARD_JUMP at the end of a for loopmiss-islington
commented
Aug 22, 2023
Thanks @iritkatriel for the PR 🌮🎉.. I'm working now to backport this PR to: 3.11. |
miss-islington
commented
Aug 22, 2023
Thanks @iritkatriel for the PR 🌮🎉.. I'm working now to backport this PR to: 3.12. |
miss-islington
commented
Aug 22, 2023
Sorry, @iritkatriel, I could not cleanly backport this to |
…of a for loop (pythonGH-108242) (cherry picked from commit a1cc74c) Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
bedevere-bot
commented
Aug 22, 2023
GH-108275 is a backport of this pull request to the 3.12 branch. |
| 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); |
There was a problem hiding this comment.
This is the last physical location, not the last location executed. Won't it give the wrong line for the following?
ALWAYS_TRUE=Truedeffoo():
while1:
ifALWAYS_TRUE:
pass# last line executedelse:
pass# last physical lineThere was a problem hiding this comment.
no, last is the conditional backwards jump that this jump is replacing (and which is replaced by a forward jump).
Uh oh!
There was an error while loading. Please reload this page.