From 0d70eb190e8ae7f77be0082063d4ce5765b09f26 Mon Sep 17 00:00:00 2001 From: Anders Kaseorg Date: Mon, 16 Sep 2024 16:18:54 -0700 Subject: [PATCH] Remove asserts that confuse enum _framestate with enum _frameowner The owner field of _PyInterpreterFrame is supposed to be a member of enum _frameowner, but FRAME_CLEARED is a member of enum _framestate. At present, it happens that FRAME_CLEARED is not numerically equal to any member of enum _frameowner, but that could change in the future. The code that incorrectly assigned owner = FRAME_CLEARED was deleted in commit a53cc3f49463e50cb3e2b839b3a82e6bf7f73fee (GH-116687). Remove the incorrect checks for owner != FRAME_CLEARED as well. Signed-off-by: Anders Kaseorg --- Python/frame.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/Python/frame.c b/Python/frame.c index d7bb29811bfa50..4912a3129cc724 100644 --- a/Python/frame.c +++ b/Python/frame.c @@ -43,7 +43,6 @@ _PyFrame_MakeAndSetFrameObject(_PyInterpreterFrame *frame) // here. assert(frame->frame_obj == NULL); assert(frame->owner != FRAME_OWNED_BY_FRAME_OBJECT); - assert(frame->owner != FRAME_CLEARED); f->f_frame = frame; frame->frame_obj = f; return f; @@ -54,7 +53,6 @@ take_ownership(PyFrameObject *f, _PyInterpreterFrame *frame) { assert(frame->owner != FRAME_OWNED_BY_CSTACK); assert(frame->owner != FRAME_OWNED_BY_FRAME_OBJECT); - assert(frame->owner != FRAME_CLEARED); Py_ssize_t size = ((char*)frame->stackpointer) - (char *)frame; memcpy((_PyInterpreterFrame *)f->_f_frame_data, frame, size); frame = (_PyInterpreterFrame *)f->_f_frame_data;