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
assert for NULL in Py_INCREF Py_DECREF #43622
Comments
Since Py_INCREF and Py_DECREF should not be able to This would have caught at least one bug earlier in It will also help other extension module authors find Include/object.h
#define Py_INCREF(op) ( \
(assert((op) != NULL)) , \
_Py_INC_REFTOTAL _Py_REF_DEBUG_COMMA \
(op)->ob_refcnt++)
#define Py_DECREF(op) \
if ((assert((op) != NULL)) , _Py_DEC_REFTOTAL
_Py_REF_DEBUG_COMMA \
--(op)->ob_refcnt != 0) \
_Py_CHECK_REFCNT(op) \
else \
_Py_Dealloc((PyObject *)(op)) |
Logged In: YES I don't think that the cPickle bug would have been any Regardless, the adding of the assert() in Py_DECREF might |
Quoting Martin v. Löwis: Rejecting on that basis. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: