Skip to content

Commit

Permalink
gh-101975: Fixed a potential SegFault on garbage collection (GH-102803)
Browse files Browse the repository at this point in the history
  • Loading branch information
gaogaotiantian authored Mar 18, 2023
1 parent b3cc11a commit 039714d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fixed ``stacktop`` value on tracing entries to avoid corruption on garbage collection.
1 change: 1 addition & 0 deletions Python/ceval_macros.h
Original file line number Diff line number Diff line change
Expand Up @@ -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; \
} \
Expand Down

0 comments on commit 039714d

Please sign in to comment.