Skip to content
Prev Previous commit
Next Next commit
address review comment
  • Loading branch information
Fidget-Spinner committed Dec 11, 2025
commit 00f78182a84d9205b5371aabc6d954448a417371
4 changes: 2 additions & 2 deletions Python/optimizer_analysis.c
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ incorrect_keys(PyObject *obj, uint32_t version)


#define STACK_LEVEL() ((int)(stack_pointer - ctx->frame->stack))
#define STACK_SIZE() ((int)(ctx->frame->stack_len) + MAX_CACHED_REGISTER)
#define STACK_SIZE() ((int)(ctx->frame->stack_len))

#define CURRENT_FRAME_IS_INIT_SHIM() (ctx->frame->code == ((PyCodeObject *)&_Py_InitCleanup))

Expand Down Expand Up @@ -196,7 +196,7 @@ check_stack_bounds(JitOptContext *ctx, JitOptRef *stack_pointer, int offset, int
(opcode == _RETURN_VALUE) ||
(opcode == _RETURN_GENERATOR) ||
(opcode == _YIELD_VALUE);
if (should_check && (stack_level < 0 || stack_level > STACK_SIZE())) {
if (should_check && (stack_level < 0 || stack_level > STACK_SIZE() + MAX_CACHED_REGISTER)) {
ctx->contradiction = true;
ctx->done = true;
return 1;
Expand Down
Loading