From 07a44d9572c7746568a7fe2fbcd42127fd6d4019 Mon Sep 17 00:00:00 2001 From: Inada Naoki Date: Thu, 22 Oct 2020 11:06:07 +0900 Subject: bpo-42057: Fix peephole optimizer (GH-22802) --- .../next/Core and Builtins/2020-10-20-11-36-14.bpo-42057.BI-OoV.rst | 2 ++ Python/peephole.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 Misc/NEWS.d/next/Core and Builtins/2020-10-20-11-36-14.bpo-42057.BI-OoV.rst 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 0000000..95c3a24 --- /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 84de1ab..6954c87 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) -- cgit v0.12