diff options
author | Bill Fisher <william.w.fisher@gmail.com> | 2022-12-23 14:45:53 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-12-23 14:45:53 (GMT) |
commit | 88d565f32a709140664444c6dea20ecd35a10e94 (patch) | |
tree | bd185455ee0b70ed60f6ca29479f2fb918999599 /Include/internal/pycore_frame.h | |
parent | 2659036c757a11235c4abd21f02c3a548a344fe7 (diff) | |
download | cpython-88d565f32a709140664444c6dea20ecd35a10e94.zip cpython-88d565f32a709140664444c6dea20ecd35a10e94.tar.gz cpython-88d565f32a709140664444c6dea20ecd35a10e94.tar.bz2 |
gh-99110: Initialize `frame->previous` in init_frame to fix segmentation fault when accessing `frame.f_back` (#100182)
Diffstat (limited to 'Include/internal/pycore_frame.h')
-rw-r--r-- | Include/internal/pycore_frame.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Include/internal/pycore_frame.h b/Include/internal/pycore_frame.h index 7fa410d..f18723b 100644 --- a/Include/internal/pycore_frame.h +++ b/Include/internal/pycore_frame.h @@ -96,7 +96,10 @@ static inline void _PyFrame_StackPush(_PyInterpreterFrame *f, PyObject *value) { void _PyFrame_Copy(_PyInterpreterFrame *src, _PyInterpreterFrame *dest); -/* Consumes reference to func and locals */ +/* Consumes reference to func and locals. + Does not initialize frame->previous, which happens + when frame is linked into the frame stack. + */ static inline void _PyFrame_InitializeSpecials( _PyInterpreterFrame *frame, PyFunctionObject *func, |