mirror of
https://github.com/python/cpython.git
synced 2025-11-10 02:21:40 +00:00
[3.11] gh-101975: Fixed a potential SegFault on garbage collection (GH-102803) (GH-102807)
Authored-by: gaogaotiantian <gaogaotiantian@hotmail.com>
This commit is contained in:
parent
98833563e2
commit
d149f15d63
2 changed files with 2 additions and 0 deletions
|
|
@ -0,0 +1 @@
|
||||||
|
Fixed ``stacktop`` value on tracing entries to avoid corruption on garbage collection.
|
||||||
|
|
@ -1536,6 +1536,7 @@ eval_frame_handle_pending(PyThreadState *tstate)
|
||||||
_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