mirror of
https://github.com/python/cpython.git
synced 2025-08-31 05:58:33 +00:00
Issue #26200: Added Py_SETREF and replaced Py_XSETREF with Py_SETREF
in places where Py_DECREF was used.
This commit is contained in:
commit
f01e408c16
23 changed files with 58 additions and 48 deletions
|
@ -730,7 +730,7 @@ setup_context(Py_ssize_t stack_level, PyObject **filename, int *lineno,
|
|||
goto handle_error;
|
||||
}
|
||||
else if (!is_true) {
|
||||
Py_XSETREF(*filename, PyUnicode_FromString("__main__"));
|
||||
Py_SETREF(*filename, PyUnicode_FromString("__main__"));
|
||||
if (*filename == NULL)
|
||||
goto handle_error;
|
||||
}
|
||||
|
|
|
@ -3236,7 +3236,7 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
|
|||
Py_INCREF(self);
|
||||
func = PyMethod_GET_FUNCTION(func);
|
||||
Py_INCREF(func);
|
||||
Py_XSETREF(*pfunc, self);
|
||||
Py_SETREF(*pfunc, self);
|
||||
na++;
|
||||
/* n++; */
|
||||
} else
|
||||
|
@ -4747,7 +4747,7 @@ call_function(PyObject ***pp_stack, int oparg
|
|||
Py_INCREF(self);
|
||||
func = PyMethod_GET_FUNCTION(func);
|
||||
Py_INCREF(func);
|
||||
Py_XSETREF(*pfunc, self);
|
||||
Py_SETREF(*pfunc, self);
|
||||
na++;
|
||||
n++;
|
||||
} else
|
||||
|
|
|
@ -311,9 +311,9 @@ finally:
|
|||
--tstate->recursion_depth;
|
||||
/* throw away the old exception and use the recursion error instead */
|
||||
Py_INCREF(PyExc_RecursionError);
|
||||
Py_XSETREF(*exc, PyExc_RecursionError);
|
||||
Py_SETREF(*exc, PyExc_RecursionError);
|
||||
Py_INCREF(PyExc_RecursionErrorInst);
|
||||
Py_XSETREF(*val, PyExc_RecursionErrorInst);
|
||||
Py_SETREF(*val, PyExc_RecursionErrorInst);
|
||||
/* just keeping the old traceback */
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue