Skip to content

Always initialize exception handler for new instruction #137655

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

DinoV
Copy link
Contributor

@DinoV DinoV commented Aug 11, 2025

basicblock_addop zero initializes some members but not all. If we remove some nops and then later re-add an instruction we can have previously initialized memory that can include an exception handler. If we compile something like:

def foo():
    try:
        [x for x in abc]
    except OSError:
        pass

    return```

We'll end up with different exception handling table because the `NOT_TAKEN` instruction is inserted after we do the exception handling analysis and gets a previously initialized exception handler.

@DinoV DinoV force-pushed the flowgraph_init_except branch from a3e0387 to 9e390cb Compare August 11, 2025 23:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant