Skip to content

Commit 00f7818

Browse files
address review comment
1 parent 207dc05 commit 00f7818

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Python/optimizer_analysis.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ incorrect_keys(PyObject *obj, uint32_t version)
140140

141141

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

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

@@ -196,7 +196,7 @@ check_stack_bounds(JitOptContext *ctx, JitOptRef *stack_pointer, int offset, int
196196
(opcode == _RETURN_VALUE) ||
197197
(opcode == _RETURN_GENERATOR) ||
198198
(opcode == _YIELD_VALUE);
199-
if (should_check && (stack_level < 0 || stack_level > STACK_SIZE())) {
199+
if (should_check && (stack_level < 0 || stack_level > STACK_SIZE() + MAX_CACHED_REGISTER)) {
200200
ctx->contradiction = true;
201201
ctx->done = true;
202202
return 1;

0 commit comments

Comments
 (0)