@@ -2002,10 +2002,10 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, _PyInterpreterFrame *frame, int
20022002 PyObject * right = TOP ();
20032003 DEOPT_IF (!PyUnicode_CheckExact (left ), BINARY_OP );
20042004 DEOPT_IF (Py_TYPE (right ) != Py_TYPE (left ), BINARY_OP );
2005- DEOPT_IF (Py_REFCNT (left ) != 2 , BINARY_OP );
20062005 _Py_CODEUNIT true_next = next_instr [INLINE_CACHE_ENTRIES_BINARY_OP ];
20072006 int next_oparg = _Py_OPARG (true_next );
2008- assert (_Py_OPCODE (true_next ) == STORE_FAST );
2007+ assert (_Py_OPCODE (true_next ) == STORE_FAST ||
2008+ _Py_OPCODE (true_next ) == STORE_FAST__LOAD_FAST );
20092009 /* In the common case, there are 2 references to the value
20102010 * stored in 'variable' when the v = v + ... is performed: one
20112011 * on the value stack (in 'v') and one still stored in the
@@ -2016,7 +2016,8 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, _PyInterpreterFrame *frame, int
20162016 DEOPT_IF (var != left , BINARY_OP );
20172017 STAT_INC (BINARY_OP , hit );
20182018 GETLOCAL (next_oparg ) = NULL ;
2019- Py_DECREF (left );
2019+ assert (Py_REFCNT (left ) >= 2 );
2020+ Py_DECREF (left ); // XXX never need to dealloc
20202021 STACK_SHRINK (1 );
20212022 PyUnicode_Append (& TOP (), right );
20222023 Py_DECREF (right );
@@ -5378,7 +5379,7 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, _PyInterpreterFrame *frame, int
53785379 PyObject * lhs = SECOND ();
53795380 PyObject * rhs = TOP ();
53805381 next_instr -- ;
5381- _Py_Specialize_BinaryOp (lhs , rhs , next_instr , oparg );
5382+ _Py_Specialize_BinaryOp (lhs , rhs , next_instr , oparg , & GETLOCAL ( 0 ) );
53825383 DISPATCH ();
53835384 }
53845385 else {
0 commit comments