mirror of
https://github.com/python/cpython.git
synced 2026-04-15 00:00:57 +00:00
[3.14] gh-146092: Fix error handling in _BINARY_OP_ADD_FLOAT opcode (#146119)
Fix error handling in _PyFloat_FromDouble_ConsumeInputs() used by _BINARY_OP_ADD_FLOAT, _BINARY_OP_SUBTRACT_FLOAT and _BINARY_OP_MULTIPLY_FLOAT opcodes. PyStackRef_FromPyObjectSteal() must not be called with a NULL pointer. Fix also _BINARY_OP_INPLACE_ADD_UNICODE opcode.
This commit is contained in:
parent
cfdc5e86dd
commit
7f29c1d0da
5 changed files with 18 additions and 11 deletions
|
|
@ -793,9 +793,12 @@ dummy_func(
|
|||
PyObject *temp = PyStackRef_AsPyObjectSteal(*target_local);
|
||||
PyObject *right_o = PyStackRef_AsPyObjectSteal(right);
|
||||
PyUnicode_Append(&temp, right_o);
|
||||
*target_local = PyStackRef_FromPyObjectSteal(temp);
|
||||
Py_DECREF(right_o);
|
||||
ERROR_IF(PyStackRef_IsNull(*target_local));
|
||||
if (temp == NULL) {
|
||||
*target_local = PyStackRef_NULL;
|
||||
ERROR_IF(true);
|
||||
}
|
||||
*target_local = PyStackRef_FromPyObjectSteal(temp);
|
||||
#if TIER_ONE
|
||||
// The STORE_FAST is already done. This is done here in tier one,
|
||||
// and during trace projection in tier two:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue