]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-133713: Compare the `f->stackpointer` to the result of `_PyFrame_Stackbase(f)...
authorNybblista <170842536+nybblista@users.noreply.github.com>
Sat, 10 May 2025 03:04:32 +0000 (06:04 +0300)
committerGitHub <noreply@github.com>
Sat, 10 May 2025 03:04:32 +0000 (11:04 +0800)
Include/internal/pycore_interpframe.h

index d3fd218b27eed7fd41f3bbf0204e26f0e391840d..2ee3696317c72709a098cd32e25014277da06a2b 100644 (file)
@@ -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;
 }