summaryrefslogtreecommitdiffstats
path: root/Python/flowgraph.c
diff options
context:
space:
mode:
authorIrit Katriel <1055913+iritkatriel@users.noreply.github.com>2023-12-23 13:29:11 (GMT)
committerGitHub <noreply@github.com>2023-12-23 13:29:11 (GMT)
commit9d72a5cae7a545bc3e525e633ae3539869ccc171 (patch)
treec1b3206c263bb669922003726973fd73776578de /Python/flowgraph.c
parent4882d508be46eff5ae2d55d82f0aab169a59a0ed (diff)
downloadcpython-9d72a5cae7a545bc3e525e633ae3539869ccc171.zip
cpython-9d72a5cae7a545bc3e525e633ae3539869ccc171.tar.gz
cpython-9d72a5cae7a545bc3e525e633ae3539869ccc171.tar.bz2
[3.12] gh-113297: Fix segfault in compiler for with statement with 19 context managers (#113327) (#113404)
Diffstat (limited to 'Python/flowgraph.c')
-rw-r--r--Python/flowgraph.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/Python/flowgraph.c b/Python/flowgraph.c
index b53e771..fbbe053 100644
--- a/Python/flowgraph.c
+++ b/Python/flowgraph.c
@@ -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;
}