From d89aa25db5c7b241b95d1920e47155f35bcdb81c Mon Sep 17 00:00:00 2001 From: Pieter Eendebak Date: Mon, 23 Dec 2024 19:10:21 +0100 Subject: [PATCH] test long_dealloc as well --- Objects/longobject.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Objects/longobject.c b/Objects/longobject.c index 83a7d0066a76eb..6cbfdf68e00e48 100644 --- a/Objects/longobject.c +++ b/Objects/longobject.c @@ -3646,7 +3646,6 @@ _PyLong_ExactDealloc(PyObject *self) static void long_dealloc(PyObject *self) { -#ifndef Py_GIL_DISABLED if (_long_is_small_int(self)) { /* This should never get called, but we also don't want to SEGV if * we accidentally decref small Ints out of existence. Instead, @@ -3654,10 +3653,11 @@ long_dealloc(PyObject *self) * * See PEP 683, section Accidental De-Immortalizing for details */ + printf("rare event: dealloc of small int\n"); + exit(1); _Py_SetImmortal(self); return; } -#endif if (PyLong_CheckExact(self) && _PyLong_IsCompact((PyLongObject *)self)) { _Py_FREELIST_FREE(ints, self, PyObject_Free); return;