Repository navigation
GH-119866: Spill stack pointer when making "escaping" calls. #119875
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
bd94999
e12729e
f748355
0a50860
c2775e0
2bd1339
792c553
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -165,6 +165,9 @@ _PyFrame_GetLocalsArray(_PyInterpreterFrame *frame) | |
| static inline PyObject** | ||
| _PyFrame_GetStackPointer(_PyInterpreterFrame *frame) | ||
| { | ||
| #ifndef Py_DEBUG | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Shouldn't this (and the corresponding line in the next function) be
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks. |
||
| PyThreadState_GET()->sp_cached++; | ||
| #endif | ||
| assert(frame->stackpointer != NULL); | ||
| PyObject **sp = frame->stackpointer; | ||
| frame->stackpointer = NULL; | ||
|
|
@@ -174,6 +177,9 @@ _PyFrame_GetStackPointer(_PyInterpreterFrame *frame) | |
| static inline void | ||
| _PyFrame_SetStackPointer(_PyInterpreterFrame *frame, PyObject **stack_pointer) | ||
| { | ||
| #ifndef Py_DEBUG | ||
| PyThreadState_GET()->sp_cached--; | ||
| #endif | ||
| assert(frame->stackpointer == NULL); | ||
| frame->stackpointer = stack_pointer; | ||
| } | ||
|
|
||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If only used in debug builds, should this be inside
#ifdef Py_DEBUG?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think debug builds have the same ABI compatibility as release builds these days. I know we like to pretend that
PyThreadStateis opaque, but this seems like it might case some nasty bugs if we do this.