From 6876257eaabdb30f27ebcbd7d2557278ce2e5705 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Mon, 7 Oct 2019 18:42:01 +0200 Subject: bpo-36389: _PyObject_CheckConsistency() available in release mode (GH-16612) bpo-36389, bpo-38376: The _PyObject_CheckConsistency() function is now also available in release mode. For example, it can be used to debug a crash in the visit_decref() function of the GC. Modify the following functions to also work in release mode: * _PyDict_CheckConsistency() * _PyObject_CheckConsistency() * _PyType_CheckConsistency() * _PyUnicode_CheckConsistency() Other changes: * _PyMem_IsPtrFreed(ptr) now also returns 1 if ptr is NULL (equals to 0). * _PyBytesWriter_CheckConsistency() now returns 1 and is only used with assert(). * Reorder _PyObject_Dump() to write safe fields first, and only attempt to render repr() at the end. --- Modules/gcmodule.c | 1 - 1 file changed, 1 deletion(-) (limited to 'Modules/gcmodule.c') diff --git a/Modules/gcmodule.c b/Modules/gcmodule.c index b95f676663..107ce39967 100644 --- a/Modules/gcmodule.c +++ b/Modules/gcmodule.c @@ -375,7 +375,6 @@ update_refs(PyGC_Head *containers) static int visit_decref(PyObject *op, void *data) { - assert(op != NULL); _PyObject_ASSERT(op, !_PyObject_IsFreed(op)); if (PyObject_IS_GC(op)) { -- cgit v1.2.1