https://github.com/python/cpython/commit/832058274dd99e30321a5f9a3773038cd0424c11
commit: 832058274dd99e30321a5f9a3773038cd0424c11
branch: main
author: Nybblista <[email protected]>
committer: Fidget-Spinner <[email protected]>
date: 2025-05-10T11:04:32+08:00
summary:
gh-133713: Compare the `f->stackpointer` to the result of
`_PyFrame_Stackbase(f)` (GH-133714)
files:
M Include/internal/pycore_interpframe.h
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;
}
_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-checkins.python.org/
Member address: [email protected]