Skip to content

Commit

Permalink
Don't ever decrement datastack_top!
Browse files Browse the repository at this point in the history
  • Loading branch information
gvanrossum committed Mar 6, 2024
1 parent c7ad988 commit 2f9539b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
6 changes: 4 additions & 2 deletions Python/bytecodes.c
Original file line number Diff line number Diff line change
Expand Up @@ -4160,9 +4160,11 @@ dummy_func(

op(_GROW_TIER2_FRAME, (--)) {
DEOPT_IF(frame->owner != FRAME_OWNED_BY_THREAD);
DEOPT_IF(stack_pointer + oparg > tstate->datastack_limit);
assert(stack_pointer <= tstate->datastack_top);
tstate->datastack_top = stack_pointer + oparg;
if (stack_pointer + oparg > tstate->datastack_top) {
DEOPT_IF(stack_pointer + oparg > tstate->datastack_limit);
tstate->datastack_top = stack_pointer + oparg;
}
}


Expand Down
6 changes: 4 additions & 2 deletions Python/executor_cases.c.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Python/optimizer_cases.c.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 2f9539b

Please sign in to comment.