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

(cherry picked from commit 77c839c98f)

Co-authored-by: Christian Heimes <christian@python.org>
This commit is contained in:
Miss Islington (bot) 2022-06-21 00:01:52 -07:00 committed by GitHub
parent b8fe3bd1d4
commit 2733c64e28
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View file

@ -0,0 +1 @@
Fix unreachable code warning in ``Python/specialize.c``.

View file

@ -1905,13 +1905,14 @@ _Py_Specialize_CompareOp(PyObject *lhs, PyObject *rhs, _Py_CODEUNIT *instr,
#ifndef Py_STATS #ifndef Py_STATS
_Py_SET_OPCODE(*instr, COMPARE_OP); _Py_SET_OPCODE(*instr, COMPARE_OP);
return; return;
#endif #else
if (next_opcode == EXTENDED_ARG) { if (next_opcode == EXTENDED_ARG) {
SPECIALIZATION_FAIL(COMPARE_OP, SPEC_FAIL_COMPARE_OP_EXTENDED_ARG); SPECIALIZATION_FAIL(COMPARE_OP, SPEC_FAIL_COMPARE_OP_EXTENDED_ARG);
goto failure; goto failure;
} }
SPECIALIZATION_FAIL(COMPARE_OP, SPEC_FAIL_COMPARE_OP_NOT_FOLLOWED_BY_COND_JUMP); SPECIALIZATION_FAIL(COMPARE_OP, SPEC_FAIL_COMPARE_OP_NOT_FOLLOWED_BY_COND_JUMP);
goto failure; goto failure;
#endif
} }
assert(oparg <= Py_GE); assert(oparg <= Py_GE);
int when_to_jump_mask = compare_masks[oparg]; int when_to_jump_mask = compare_masks[oparg];