Skip to content

Commit 039714d

Browse files
gh-101975: Fixed a potential SegFault on garbage collection (GH-102803)
1 parent b3cc11a commit 039714d

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
@@ -310,6 +310,7 @@ GETITEM(PyObject *v, Py_ssize_t i) {
310310
_PyFrame_SetStackPointer(frame, stack_pointer); \
311311
int err = trace_function_entry(tstate, frame); \
312312
stack_pointer = _PyFrame_GetStackPointer(frame); \
313+
frame->stacktop = -1; \
313314
if (err) { \
314315
goto error; \
315316
} \

0 commit comments

Comments
 (0)