[Python-checkins] gh-94021: Address unreachable code warning in specialize code (GH-94022)

miss-islington webhook-mailer at python.org
Tue Jun 21 03:02:00 EDT 2022


https://github.com/python/cpython/commit/2733c64e2868bb76ba532a15aca878ff4a2e380a
commit: 2733c64e2868bb76ba532a15aca878ff4a2e380a
branch: 3.11
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: miss-islington <31488909+miss-islington at users.noreply.github.com>
date: 2022-06-21T00:01:52-07:00
summary:

gh-94021: Address unreachable code warning in specialize code (GH-94022)

(cherry picked from commit 77c839c98fe57dcb01f5cad2e65fb4cac5a052c1)

Co-authored-by: Christian Heimes <christian at python.org>

files:
A Misc/NEWS.d/next/Core and Builtins/2022-06-20-13-48-57.gh-issue-94021.o78q3G.rst
M Python/specialize.c

diff --git a/Misc/NEWS.d/next/Core and Builtins/2022-06-20-13-48-57.gh-issue-94021.o78q3G.rst b/Misc/NEWS.d/next/Core and Builtins/2022-06-20-13-48-57.gh-issue-94021.o78q3G.rst
new file mode 100644
index 0000000000000..0724c517b2ba0
--- /dev/null
+++ b/Misc/NEWS.d/next/Core and Builtins/2022-06-20-13-48-57.gh-issue-94021.o78q3G.rst	
@@ -0,0 +1 @@
+Fix unreachable code warning in ``Python/specialize.c``.
diff --git a/Python/specialize.c b/Python/specialize.c
index fa42993606fd6..80d952c90a813 100644
--- a/Python/specialize.c
+++ b/Python/specialize.c
@@ -1905,13 +1905,14 @@ _Py_Specialize_CompareOp(PyObject *lhs, PyObject *rhs, _Py_CODEUNIT *instr,
 #ifndef Py_STATS
         _Py_SET_OPCODE(*instr, COMPARE_OP);
         return;
-#endif
+#else
         if (next_opcode == EXTENDED_ARG) {
             SPECIALIZATION_FAIL(COMPARE_OP, SPEC_FAIL_COMPARE_OP_EXTENDED_ARG);
             goto failure;
         }
         SPECIALIZATION_FAIL(COMPARE_OP, SPEC_FAIL_COMPARE_OP_NOT_FOLLOWED_BY_COND_JUMP);
         goto failure;
+#endif
     }
     assert(oparg <= Py_GE);
     int when_to_jump_mask = compare_masks[oparg];



More information about the Python-checkins mailing list