Skip to content

Conversation

@corona10
Copy link
Member

@corona10 corona10 commented Jan 31, 2023

…ue/break which are not in a loop (GH-101413).

(cherry picked from commit e867c1b)

Co-authored-by: Dong-hee Na [email protected]

…continue/break which are not in a loop (pythonGH-101413).

(cherry picked from commit e867c1b)

Co-authored-by: Dong-hee Na <[email protected]>
@corona10
Copy link
Member Author

corona10 commented Jan 31, 2023

cpython/Python/compile.c

Lines 1841 to 1846 in 17b038c

ADDOP(c, POP_TOP);
/* The exit block should appear to execute after the
* statement causing the unwinding, so make the unwinding
* instruction artificial */
c->u->u_lineno = -1;
return 1;

@iritkatriel

For 3.10, it only modifies the u_lineno, so just restoring the u_lineno will be enough WDYT?

@corona10 corona10 merged commit 740050a into python:3.10 Jan 31, 2023
@corona10 corona10 deleted the backport-e867c1b-3.10 branch January 31, 2023 14:42
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.

3 participants