Skip to content

Commit 3d093c0

Browse files
committed
mark _PyOptimizer_Optimize as no inline
1 parent a10152f commit 3d093c0

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Mark :c:func:`_PyOptimizer_Optimize` as :c:macro:`Py_NO_INLINE` to
2+
prevent stack overflow crashes on MacOS.

Python/optimizer.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ uop_optimize(_PyInterpreterFrame *frame, _Py_CODEUNIT *instr,
109109
/* Returns 1 if optimized, 0 if not optimized, and -1 for an error.
110110
* If optimized, *executor_ptr contains a new reference to the executor
111111
*/
112-
int
112+
Py_NO_INLINE int
113113
_PyOptimizer_Optimize(
114114
_PyInterpreterFrame *frame, _Py_CODEUNIT *start,
115115
_PyExecutorObject **executor_ptr, int chain_depth)

0 commit comments

Comments
 (0)