Skip to content

gh-90667: Cast to destructor to fix warnings #91711

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 20, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Objects/longobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ static inline void
_Py_DECREF_INT(PyLongObject *op)
{
assert(PyLong_CheckExact(op));
_Py_DECREF_SPECIALIZED((PyObject *)op, PyObject_Free);
_Py_DECREF_SPECIALIZED((PyObject *)op, (destructor)PyObject_Free);
}

static inline int
Expand Down
22 changes: 11 additions & 11 deletions Python/ceval.c
Original file line number Diff line number Diff line change
Expand Up @@ -1977,8 +1977,8 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, _PyInterpreterFrame *frame, int
STAT_INC(BINARY_OP, hit);
PyObject *prod = _PyLong_Multiply((PyLongObject *)left, (PyLongObject *)right);
SET_SECOND(prod);
_Py_DECREF_SPECIALIZED(right, PyObject_Free);
_Py_DECREF_SPECIALIZED(left, PyObject_Free);
_Py_DECREF_SPECIALIZED(right, (destructor)PyObject_Free);
_Py_DECREF_SPECIALIZED(left, (destructor)PyObject_Free);
STACK_SHRINK(1);
if (prod == NULL) {
goto error;
Expand Down Expand Up @@ -2017,8 +2017,8 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, _PyInterpreterFrame *frame, int
STAT_INC(BINARY_OP, hit);
PyObject *sub = _PyLong_Subtract((PyLongObject *)left, (PyLongObject *)right);
SET_SECOND(sub);
_Py_DECREF_SPECIALIZED(right, PyObject_Free);
_Py_DECREF_SPECIALIZED(left, PyObject_Free);
_Py_DECREF_SPECIALIZED(right, (destructor)PyObject_Free);
_Py_DECREF_SPECIALIZED(left, (destructor)PyObject_Free);
STACK_SHRINK(1);
if (sub == NULL) {
goto error;
Expand Down Expand Up @@ -2132,8 +2132,8 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, _PyInterpreterFrame *frame, int
STAT_INC(BINARY_OP, hit);
PyObject *sum = _PyLong_Add((PyLongObject *)left, (PyLongObject *)right);
SET_SECOND(sum);
_Py_DECREF_SPECIALIZED(right, PyObject_Free);
_Py_DECREF_SPECIALIZED(left, PyObject_Free);
_Py_DECREF_SPECIALIZED(right, (destructor)PyObject_Free);
_Py_DECREF_SPECIALIZED(left, (destructor)PyObject_Free);
STACK_SHRINK(1);
if (sum == NULL) {
goto error;
Expand Down Expand Up @@ -2192,7 +2192,7 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, _PyInterpreterFrame *frame, int
assert(res != NULL);
Py_INCREF(res);
STACK_SHRINK(1);
_Py_DECREF_SPECIALIZED(sub, PyObject_Free);
_Py_DECREF_SPECIALIZED(sub, (destructor)PyObject_Free);
SET_TOP(res);
Py_DECREF(list);
JUMPBY(INLINE_CACHE_ENTRIES_BINARY_SUBSCR);
Expand All @@ -2217,7 +2217,7 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, _PyInterpreterFrame *frame, int
assert(res != NULL);
Py_INCREF(res);
STACK_SHRINK(1);
_Py_DECREF_SPECIALIZED(sub, PyObject_Free);
_Py_DECREF_SPECIALIZED(sub, (destructor)PyObject_Free);
SET_TOP(res);
Py_DECREF(tuple);
JUMPBY(INLINE_CACHE_ENTRIES_BINARY_SUBSCR);
Expand Down Expand Up @@ -2359,7 +2359,7 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, _PyInterpreterFrame *frame, int
STACK_SHRINK(3);
assert(old_value != NULL);
Py_DECREF(old_value);
_Py_DECREF_SPECIALIZED(sub, PyObject_Free);
_Py_DECREF_SPECIALIZED(sub, (destructor)PyObject_Free);
Py_DECREF(list);
JUMPBY(INLINE_CACHE_ENTRIES_STORE_SUBSCR);
NOTRACE_DISPATCH();
Expand Down Expand Up @@ -3795,8 +3795,8 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, _PyInterpreterFrame *frame, int
JUMPBY(INLINE_CACHE_ENTRIES_COMPARE_OP);
NEXTOPARG();
STACK_SHRINK(2);
_Py_DECREF_SPECIALIZED(left, PyObject_Free);
_Py_DECREF_SPECIALIZED(right, PyObject_Free);
_Py_DECREF_SPECIALIZED(left, (destructor)PyObject_Free);
_Py_DECREF_SPECIALIZED(right, (destructor)PyObject_Free);
assert(opcode == POP_JUMP_FORWARD_IF_FALSE ||
opcode == POP_JUMP_BACKWARD_IF_FALSE ||
opcode == POP_JUMP_FORWARD_IF_TRUE ||
Expand Down