gh-101975: Fixed a potential SegFault on garbage collection (GH-102803)

This commit is contained in:
gaogaotiantian 2023-03-18 03:59:21 -07:00 committed by GitHub
parent b3cc11a08e
commit 039714d00f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 0 deletions

View File

@ -0,0 +1 @@
Fixed ``stacktop`` value on tracing entries to avoid corruption on garbage collection.

View File

@ -310,6 +310,7 @@ GETITEM(PyObject *v, Py_ssize_t i) {
_PyFrame_SetStackPointer(frame, stack_pointer); \
int err = trace_function_entry(tstate, frame); \
stack_pointer = _PyFrame_GetStackPointer(frame); \
frame->stacktop = -1; \
if (err) { \
goto error; \
} \