Skip to content

Commit 8320582

Browse files
authored
pythongh-133713: Compare the f->stackpointer to the result of _PyFrame_Stackbase(f) (pythonGH-133714)
1 parent 50b5370 commit 8320582

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Include/internal/pycore_interpframe.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,13 @@ static inline _PyStackRef *_PyFrame_Stackbase(_PyInterpreterFrame *f) {
4848
}
4949

5050
static inline _PyStackRef _PyFrame_StackPeek(_PyInterpreterFrame *f) {
51-
assert(f->stackpointer > f->localsplus + _PyFrame_GetCode(f)->co_nlocalsplus);
51+
assert(f->stackpointer > _PyFrame_Stackbase(f));
5252
assert(!PyStackRef_IsNull(f->stackpointer[-1]));
5353
return f->stackpointer[-1];
5454
}
5555

5656
static inline _PyStackRef _PyFrame_StackPop(_PyInterpreterFrame *f) {
57-
assert(f->stackpointer > f->localsplus + _PyFrame_GetCode(f)->co_nlocalsplus);
57+
assert(f->stackpointer > _PyFrame_Stackbase(f));
5858
f->stackpointer--;
5959
return *f->stackpointer;
6060
}

0 commit comments

Comments
 (0)