Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions Lib/test/test_peepholer.py
Original file line number Diff line number Diff line change
Expand Up @@ -2472,6 +2472,13 @@ def test_unoptimized_if_support_killed(self):
]
self.check(insts, insts)

insts = [
("LOAD_FAST", 0, 1),
("DELETE_FAST", 0, 2),
("POP_TOP", None, 3),
]
self.check(insts, insts)

def test_unoptimized_if_aliased(self):
insts = [
("LOAD_FAST", 0, 1),
Expand Down
5 changes: 5 additions & 0 deletions Python/flowgraph.c
Original file line number Diff line number Diff line change
Expand Up @@ -2795,6 +2795,11 @@ optimize_load_fast(cfg_builder *g)
assert(opcode != EXTENDED_ARG);
switch (opcode) {
// Opcodes that load and store locals
case DELETE_FAST: {
kill_local(instr_flags, &refs, oparg);
break;
}

Comment on lines +2798 to +2802
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FWIW: This change by itself is not enough to make the crash in test_asyncio go away.

case LOAD_FAST: {
PUSH_REF(i, oparg);
break;
Expand Down
Loading