Skip to content

Commit b019008

Browse files
gaogaotiantianFidget-Spinner
authored andcommitted
pythongh-101975: Fixed a potential SegFault on garbage collection (pythonGH-102803)
1 parent e2e5fa6 commit b019008

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fixed ``stacktop`` value on tracing entries to avoid corruption on garbage collection.

Python/ceval_macros.h

+1
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,7 @@ GETITEM(PyObject *v, Py_ssize_t i) {
314314
_PyFrame_SetStackPointer(frame, stack_pointer); \
315315
int err = trace_function_entry(tstate, frame); \
316316
stack_pointer = _PyFrame_GetStackPointer(frame); \
317+
frame->stacktop = -1; \
317318
if (err) { \
318319
goto error; \
319320
} \

0 commit comments

Comments
 (0)