mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
GH-125323: Convert DECREF_INPUTS_AND_REUSE_FLOAT into a function that takes PyStackRefs. (GH-125439)
This commit is contained in:
parent
67f6e08147
commit
06ca33020e
10 changed files with 69 additions and 44 deletions
|
@ -327,26 +327,6 @@ GETITEM(PyObject *v, Py_ssize_t i) {
|
|||
" in enclosing scope"
|
||||
#define NAME_ERROR_MSG "name '%.200s' is not defined"
|
||||
|
||||
#define DECREF_INPUTS_AND_REUSE_FLOAT(left, right, dval, result) \
|
||||
do { \
|
||||
if (Py_REFCNT(left) == 1) { \
|
||||
((PyFloatObject *)left)->ob_fval = (dval); \
|
||||
_Py_DECREF_SPECIALIZED(right, _PyFloat_ExactDealloc);\
|
||||
result = (left); \
|
||||
} \
|
||||
else if (Py_REFCNT(right) == 1) {\
|
||||
((PyFloatObject *)right)->ob_fval = (dval); \
|
||||
_Py_DECREF_NO_DEALLOC(left); \
|
||||
result = (right); \
|
||||
}\
|
||||
else { \
|
||||
result = PyFloat_FromDouble(dval); \
|
||||
if ((result) == NULL) GOTO_ERROR(error); \
|
||||
_Py_DECREF_NO_DEALLOC(left); \
|
||||
_Py_DECREF_NO_DEALLOC(right); \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
// If a trace function sets a new f_lineno and
|
||||
// *then* raises, we use the destination when searching
|
||||
// for an exception handler, displaying the traceback, and so on
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue