From: Victor Stinner Date: Thu, 13 Mar 2025 09:46:20 +0000 (+0100) Subject: gh-111178: Fix PyRangeIter_Type deallocator (#131162) X-Git-Tag: v3.14.0a6~42 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=0c6c52f49605f757c4a125ca195a2123bd930b93;p=thirdparty%2FPython%2Fcpython.git gh-111178: Fix PyRangeIter_Type deallocator (#131162) Don't use PyObject_Free() as tp_dealloc to avoid an undefined behavior. Instead, use the default deallocator which just calls tp_free which is PyObject_Free(). --- diff --git a/Objects/rangeobject.c b/Objects/rangeobject.c index 6d93d778dd7f..299dcd523245 100644 --- a/Objects/rangeobject.c +++ b/Objects/rangeobject.c @@ -910,7 +910,7 @@ PyTypeObject PyRangeIter_Type = { sizeof(_PyRangeIterObject), /* tp_basicsize */ 0, /* tp_itemsize */ /* methods */ - (destructor)PyObject_Free, /* tp_dealloc */ + 0, /* tp_dealloc */ 0, /* tp_vectorcall_offset */ 0, /* tp_getattr */ 0, /* tp_setattr */