GH-119866: Don't clear frame->stackpointer on release builds (GH-131750)
This commit is contained in:
parent
2c686a9ac2
commit
4b3d5b6042
@ -163,15 +163,17 @@ _PyFrame_GetLocalsArray(_PyInterpreterFrame *frame)
|
|||||||
return frame->localsplus;
|
return frame->localsplus;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Fetches the stack pointer, and sets stackpointer to NULL.
|
// Fetches the stack pointer, and (on debug builds) sets stackpointer to NULL.
|
||||||
Having stackpointer == NULL ensures that invalid
|
// Having stackpointer == NULL makes it easier to catch missing stack pointer
|
||||||
values are not visible to the cycle GC. */
|
// spills/restores (which could expose invalid values to the GC) using asserts.
|
||||||
static inline _PyStackRef*
|
static inline _PyStackRef*
|
||||||
_PyFrame_GetStackPointer(_PyInterpreterFrame *frame)
|
_PyFrame_GetStackPointer(_PyInterpreterFrame *frame)
|
||||||
{
|
{
|
||||||
assert(frame->stackpointer != NULL);
|
assert(frame->stackpointer != NULL);
|
||||||
_PyStackRef *sp = frame->stackpointer;
|
_PyStackRef *sp = frame->stackpointer;
|
||||||
|
#ifndef NDEBUG
|
||||||
frame->stackpointer = NULL;
|
frame->stackpointer = NULL;
|
||||||
|
#endif
|
||||||
return sp;
|
return sp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user