We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0a889df commit be99bd4Copy full SHA for be99bd4
Python/optimizer.c
@@ -114,6 +114,12 @@ _PyOptimizer_Optimize(
114
_PyInterpreterFrame *frame, _Py_CODEUNIT *start,
115
_PyExecutorObject **executor_ptr, int chain_depth)
116
{
117
+ /* Make sure we have enough C stack space for the buffer */
118
+ int margin = 1 + sizeof(_PyUOpInstruction) * UOP_MAX_TRACE_LENGTH / _PyOS_STACK_MARGIN_BYTES;
119
+ if (_Py_ReachedRecursionLimitWithMargin(_PyThreadState_GET(), margin)) {
120
+ return 0;
121
+ }
122
+
123
_PyStackRef *stack_pointer = frame->stackpointer;
124
assert(_PyInterpreterState_GET()->jit);
125
// The first executor in a chain and the MAX_CHAIN_DEPTH'th executor *must*
0 commit comments