From: Nybblista <170842536+nybblista@users.noreply.github.com> Date: Sat, 10 May 2025 03:04:32 +0000 (+0300) Subject: gh-133713: Compare the `f->stackpointer` to the result of `_PyFrame_Stackbase(f)... X-Git-Tag: v3.15.0a1~1782 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=832058274dd99e30321a5f9a3773038cd0424c11;p=thirdparty%2FPython%2Fcpython.git gh-133713: Compare the `f->stackpointer` to the result of `_PyFrame_Stackbase(f)` (GH-133714) --- diff --git a/Include/internal/pycore_interpframe.h b/Include/internal/pycore_interpframe.h index d3fd218b27ee..2ee3696317c7 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; }