From 72ef45fc7e9a4df5dbba46e201ff39388a60cc92 Mon Sep 17 00:00:00 2001 From: nybblista <170842536+nybblista@users.noreply.github.com> Date: Fri, 9 May 2025 00:25:52 +0300 Subject: [PATCH] compare stackpointer to the result of the _PyFrame_Stackbase --- Include/internal/pycore_interpframe.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Include/internal/pycore_interpframe.h b/Include/internal/pycore_interpframe.h index d3fd218b27eed7..2ee3696317c727 100644 --- a/Include/internal/pycore_interpframe.h +++ b/Include/internal/pycore_interpframe.h @@ -48,13 +48,13 @@ static inline _PyStackRef *_PyFrame_Stackbase(_PyInterpreterFrame *f) { } static inline _PyStackRef _PyFrame_StackPeek(_PyInterpreterFrame *f) { - assert(f->stackpointer > f->localsplus + _PyFrame_GetCode(f)->co_nlocalsplus); + assert(f->stackpointer > _PyFrame_Stackbase(f)); assert(!PyStackRef_IsNull(f->stackpointer[-1])); return f->stackpointer[-1]; } static inline _PyStackRef _PyFrame_StackPop(_PyInterpreterFrame *f) { - assert(f->stackpointer > f->localsplus + _PyFrame_GetCode(f)->co_nlocalsplus); + assert(f->stackpointer > _PyFrame_Stackbase(f)); f->stackpointer--; return *f->stackpointer; }