[Python-checkins] bpo-42057: Fix peephole optimizer (GH-22802)

methane webhook-mailer at python.org
Wed Oct 21 22:06:11 EDT 2020


https://github.com/python/cpython/commit/07a44d9572c7746568a7fe2fbcd42127fd6d4019
commit: 07a44d9572c7746568a7fe2fbcd42127fd6d4019
branch: 3.9
author: Inada Naoki <songofacandy at gmail.com>
committer: methane <songofacandy at gmail.com>
date: 2020-10-22T11:06:07+09:00
summary:

bpo-42057: Fix peephole optimizer (GH-22802)

files:
A Misc/NEWS.d/next/Core and Builtins/2020-10-20-11-36-14.bpo-42057.BI-OoV.rst
M Python/peephole.c

diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-10-20-11-36-14.bpo-42057.BI-OoV.rst b/Misc/NEWS.d/next/Core and Builtins/2020-10-20-11-36-14.bpo-42057.BI-OoV.rst
new file mode 100644
index 0000000000000..95c3a248f9a1a
--- /dev/null
+++ b/Misc/NEWS.d/next/Core and Builtins/2020-10-20-11-36-14.bpo-42057.BI-OoV.rst	
@@ -0,0 +1,2 @@
+Fix peephole optimizer misoptimize conditional jump + JUMP_IF_NOT_EXC_MATCH
+pair.
diff --git a/Python/peephole.c b/Python/peephole.c
index 84de1abc17547..6954c87b13bfb 100644
--- a/Python/peephole.c
+++ b/Python/peephole.c
@@ -12,7 +12,7 @@
 
 #define UNCONDITIONAL_JUMP(op)  (op==JUMP_ABSOLUTE || op==JUMP_FORWARD)
 #define CONDITIONAL_JUMP(op) (op==POP_JUMP_IF_FALSE || op==POP_JUMP_IF_TRUE \
-    || op==JUMP_IF_FALSE_OR_POP || op==JUMP_IF_TRUE_OR_POP || op==JUMP_IF_NOT_EXC_MATCH)
+    || op==JUMP_IF_FALSE_OR_POP || op==JUMP_IF_TRUE_OR_POP)
 #define ABSOLUTE_JUMP(op) (op==JUMP_ABSOLUTE \
     || op==POP_JUMP_IF_FALSE || op==POP_JUMP_IF_TRUE \
     || op==JUMP_IF_FALSE_OR_POP || op==JUMP_IF_TRUE_OR_POP || op==JUMP_IF_NOT_EXC_MATCH)



More information about the Python-checkins mailing list