mirror of
https://github.com/python/cpython.git
synced 2025-08-24 18:55:00 +00:00
gh-101975: Fixed a potential SegFault on garbage collection (GH-102803)
This commit is contained in:
parent
b3cc11a08e
commit
039714d00f
2 changed files with 2 additions and 0 deletions
|
@ -0,0 +1 @@
|
||||||
|
Fixed ``stacktop`` value on tracing entries to avoid corruption on garbage collection.
|
|
@ -310,6 +310,7 @@ GETITEM(PyObject *v, Py_ssize_t i) {
|
||||||
_PyFrame_SetStackPointer(frame, stack_pointer); \
|
_PyFrame_SetStackPointer(frame, stack_pointer); \
|
||||||
int err = trace_function_entry(tstate, frame); \
|
int err = trace_function_entry(tstate, frame); \
|
||||||
stack_pointer = _PyFrame_GetStackPointer(frame); \
|
stack_pointer = _PyFrame_GetStackPointer(frame); \
|
||||||
|
frame->stacktop = -1; \
|
||||||
if (err) { \
|
if (err) { \
|
||||||
goto error; \
|
goto error; \
|
||||||
} \
|
} \
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue