Skip to content

Commit 9bec9f5

Browse files
committed
Add missing error handling
1 parent 8ea82b5 commit 9bec9f5

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

Python/flowgraph.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2631,7 +2631,9 @@ optimize_load_fast(cfg_builder *g, bool compute_stackdepth)
26312631
int max_instrs = 0;
26322632
basicblock *entryblock = g->g_entryblock;
26332633
if (compute_stackdepth) {
2634-
calculate_stackdepth(g);
2634+
if (calculate_stackdepth(g) == ERROR) {
2635+
return ERROR;
2636+
}
26352637
}
26362638
for (basicblock *b = entryblock; b != NULL; b = b->b_next) {
26372639
max_instrs = Py_MAX(max_instrs, b->b_iused);
@@ -2665,7 +2667,10 @@ optimize_load_fast(cfg_builder *g, bool compute_stackdepth)
26652667
// presence. Add dummy references as necessary.
26662668
ref_stack_clear(&refs);
26672669
for (int i = 0; i < block->b_startdepth; i++) {
2668-
ref_stack_push(&refs, DUMMY_REF);
2670+
if (ref_stack_push(&refs, DUMMY_REF) < 0) {
2671+
status = ERROR;
2672+
goto done;
2673+
}
26692674
}
26702675

26712676
for (int i = 0; i < block->b_iused; i++) {

0 commit comments

Comments
 (0)