-
-
Notifications
You must be signed in to change notification settings - Fork 33.1k
Closed
Labels
interpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Description
Bug report
Bug description:
# pyre-ignore-all-errors
def foo():
try:
[x for x in abc]
except OSError:
pass
return
import dis
dis.dis(foo)
When this code gets compiled a NOT_TAKEN
instruction gets inserted after the exception handler pass has run and no except handler block is added to it. But it re-uses an instruction that got NOP'd out and previously had an instruction handler associated with it. The end result is that the NOT_TAKEN has a rather random exception handler block associated with it.
CPython versions tested on:
3.14, CPython main branch
Operating systems tested on:
Linux
Linked PRs
Metadata
Metadata
Assignees
Labels
interpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error