[3.12] gh-113297: Fix segfault in compiler for with statement with 19 context managers (#113327) (#113404)

This commit is contained in:
Irit Katriel 2023-12-23 13:29:11 +00:00 committed by GitHub
parent 4882d508be
commit 9d72a5cae7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 29 additions and 1 deletions

View file

@ -645,6 +645,7 @@ push_except_block(ExceptStack *stack, cfg_instr *setup) {
if (opcode == SETUP_WITH || opcode == SETUP_CLEANUP) {
target->b_preserve_lasti = 1;
}
assert(stack->depth <= CO_MAXBLOCKS);
stack->handlers[++stack->depth] = target;
return target;
}