summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIrit Katriel <1055913+iritkatriel@users.noreply.github.com>2024-01-11 14:27:41 (GMT)
committerGitHub <noreply@github.com>2024-01-11 14:27:41 (GMT)
commit0d8fec79ca30e67870752c6ad4e299f591271e69 (patch)
tree2b6ecb00d1331b8b7e687ed50d98a8ca2b2830a5
parent7ed76fc368c340307290cde9f183dc0ba6dd920c (diff)
downloadcpython-0d8fec79ca30e67870752c6ad4e299f591271e69.zip
cpython-0d8fec79ca30e67870752c6ad4e299f591271e69.tar.gz
cpython-0d8fec79ca30e67870752c6ad4e299f591271e69.tar.bz2
gh-107901: jump leaving an exception handler doesn't need an eval break check (#113943)
-rw-r--r--Lib/test/test_dis.py4
-rw-r--r--Misc/NEWS.d/next/Core and Builtins/2024-01-11-14-03-31.gh-issue-107901.U65IyC.rst1
-rw-r--r--Python/flowgraph.c2
3 files changed, 4 insertions, 3 deletions
diff --git a/Lib/test/test_dis.py b/Lib/test/test_dis.py
index e46ff3d..097f05a 100644
--- a/Lib/test/test_dis.py
+++ b/Lib/test/test_dis.py
@@ -578,11 +578,11 @@ dis_asyncwith = """\
%4d L12: CLEANUP_THROW
- -- L13: JUMP_BACKWARD 26 (to L5)
+ -- L13: JUMP_BACKWARD_NO_INTERRUPT 25 (to L5)
%4d L14: CLEANUP_THROW
- -- L15: JUMP_BACKWARD 11 (to L11)
+ -- L15: JUMP_BACKWARD_NO_INTERRUPT 9 (to L11)
%4d L16: PUSH_EXC_INFO
WITH_EXCEPT_START
diff --git a/Misc/NEWS.d/next/Core and Builtins/2024-01-11-14-03-31.gh-issue-107901.U65IyC.rst b/Misc/NEWS.d/next/Core and Builtins/2024-01-11-14-03-31.gh-issue-107901.U65IyC.rst
new file mode 100644
index 0000000..5c81b66
--- /dev/null
+++ b/Misc/NEWS.d/next/Core and Builtins/2024-01-11-14-03-31.gh-issue-107901.U65IyC.rst
@@ -0,0 +1 @@
+A jump leaving an exception handler back to normal code no longer checks the eval breaker.
diff --git a/Python/flowgraph.c b/Python/flowgraph.c
index 1fcacbc..dad9457 100644
--- a/Python/flowgraph.c
+++ b/Python/flowgraph.c
@@ -2164,7 +2164,7 @@ push_cold_blocks_to_end(cfg_builder *g) {
if (!IS_LABEL(b->b_next->b_label)) {
b->b_next->b_label.id = next_lbl++;
}
- basicblock_addop(explicit_jump, JUMP, b->b_next->b_label.id, NO_LOCATION);
+ basicblock_addop(explicit_jump, JUMP_NO_INTERRUPT, b->b_next->b_label.id, NO_LOCATION);
explicit_jump->b_cold = 1;
explicit_jump->b_next = b->b_next;
b->b_next = explicit_jump;