mirror of
https://github.com/python/cpython.git
synced 2025-10-06 15:11:58 +00:00
bpo-46841: Fix BINARY_OP's handling of inline caches (GH-31671)
This commit is contained in:
parent
cedd2473a9
commit
c4d2d57eef
3 changed files with 7 additions and 3 deletions
|
@ -1951,7 +1951,8 @@ _Py_Specialize_BinaryOp(PyObject *lhs, PyObject *rhs, _Py_CODEUNIT *instr,
|
|||
break;
|
||||
}
|
||||
if (PyUnicode_CheckExact(lhs)) {
|
||||
if (_Py_OPCODE(instr[1]) == STORE_FAST && Py_REFCNT(lhs) == 2) {
|
||||
_Py_CODEUNIT next = instr[INLINE_CACHE_ENTRIES_BINARY_OP + 1];
|
||||
if (_Py_OPCODE(next) == STORE_FAST && Py_REFCNT(lhs) == 2) {
|
||||
*instr = _Py_MAKECODEUNIT(BINARY_OP_INPLACE_ADD_UNICODE,
|
||||
oparg);
|
||||
goto success;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue