Skip to content

Commit 124693c

Browse files
committed
Remove adaptivity when specialization is impossible
1 parent a0f558e commit 124693c

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Python/specialize.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1569,7 +1569,9 @@ _Py_Specialize_CompareOp(PyObject *lhs, PyObject *rhs,
15691569
int op = adaptive->original_oparg;
15701570
int next_opcode = _Py_OPCODE(instr[1]);
15711571
if (next_opcode != POP_JUMP_IF_FALSE && next_opcode != POP_JUMP_IF_TRUE) {
1572+
// Can't ever combine, so don't don't bother being adaptive.
15721573
SPECIALIZATION_FAIL(COMPARE_OP, SPEC_FAIL_NOT_FOLLOWED_BY_COND_JUMP);
1574+
*instr = _Py_MAKECODEUNIT(COMPARE_OP, adaptive->original_oparg);
15731575
goto failure;
15741576
}
15751577
assert(op <= Py_GE);

0 commit comments

Comments
 (0)