[3.8] bpo-38070: visit_decref() calls _PyObject_IsFreed() (GH-15782) by miss-islington · Pull Request #15793 · python/cpython

@vstinner @miss-islington

In debug mode, visit_decref() now calls _PyObject_IsFreed() to ensure
that the object is not freed. If it's freed, the program fails with
an assertion error and Python dumps informations about the freed
object.
(cherry picked from commit d91d4de)

Co-authored-by: Victor Stinner <vstinner@redhat.com>

vstinner