-
-
Notifications
You must be signed in to change notification settings - Fork 32.5k
gh-107901: Fix missing line number on BACKWARD_JUMP at the end of a for loop #108242
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Fix missing line number on :opcode:`BACKWARD_JUMP` at the end of a for loop. | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -531,7 +531,7 @@ normalize_jumps_in_block(cfg_builder *g, basicblock *b) { | |
if (backwards_jump == NULL) { | ||
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. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 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 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. no, |
||
backwards_jump->b_instr[0].i_target = target; | ||
last->i_opcode = reversed_opcode; | ||
last->i_target = b->b_next; | ||
|
Uh oh!
There was an error while loading. Please reload this page.