]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-133371: Don't optimize `LOAD_FAST` instructions whose local is killed by `DELETE_F...
authormpage <mpage@meta.com>
Mon, 5 May 2025 04:00:11 +0000 (21:00 -0700)
committerGitHub <noreply@github.com>
Mon, 5 May 2025 04:00:11 +0000 (21:00 -0700)
commit78adb63ee198c94c6ce2a1634aa7ea1d47c011ad
tree6f275dbcf10f347f3d7fba21f7768b9a36ed0f2b
parent2bbcaedb75942389dacb51866948f40de5951c9c
gh-133371: Don't optimize `LOAD_FAST` instructions whose local is killed by `DELETE_FAST` (#133383)

In certain cases it's possible for locals loaded by `LOAD_FAST` instructions
to be on the stack when the local is killed by `DEL_FAST`. These `LOAD_FAST`
instructions should not be optimized into `LOAD_FAST_BORROW` as the strong
reference in the frame is killed while there is still a reference on the stack.
Include/internal/pycore_magic_number.h
Lib/test/test_peepholer.py
Python/flowgraph.c