Skip to content

Commit 1eb9226

Browse files
committed
Implement two missing opcodes in the static analysis
`STORE_FAST_LOAD_FAST` and `LOAD_FAST_AND_CLEAR` both need to kill the local.
1 parent 1ef26c5 commit 1eb9226

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

Python/flowgraph.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2600,6 +2600,12 @@ optimize_load_fast(cfg_builder *g)
26002600
break;
26012601
}
26022602

2603+
case LOAD_FAST_AND_CLEAR: {
2604+
kill_local(has_killed_refs, &refs, oparg);
2605+
ref_stack_push(&refs, (ref){i, oparg});
2606+
break;
2607+
}
2608+
26032609
case LOAD_FAST_LOAD_FAST: {
26042610
if (ref_stack_push(&refs, (ref){i, oparg >> 4}) < 0) {
26052611
status = ERROR;
@@ -2618,6 +2624,13 @@ optimize_load_fast(cfg_builder *g)
26182624
break;
26192625
}
26202626

2627+
case STORE_FAST_LOAD_FAST: {
2628+
kill_local(has_killed_refs, &refs, oparg >> 4);
2629+
ref_stack_pop(&refs);
2630+
ref_stack_push(&refs, (ref){i, oparg & 15});
2631+
break;
2632+
}
2633+
26212634
case STORE_FAST_STORE_FAST: {
26222635
kill_local(has_killed_refs, &refs, oparg >> 4);
26232636
kill_local(has_killed_refs, &refs, oparg & 15);

0 commit comments

Comments
 (0)