Skip to content
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

Generator drop tracking: improve break and continue handling #93752

Merged
merged 2 commits into from
Feb 15, 2022

Commits on Feb 7, 2022

  1. Configuration menu
    Copy the full SHA
    2918584 View commit details
    Browse the repository at this point in the history

Commits on Feb 8, 2022

  1. Drop tracking: improve break and continue handling

    This commit fixes two issues.
    
    One, sometimes break or continue have a block target instead of an
    expression target. This seems to mainly happen with try blocks. Since
    the drop tracking analysis only works on expressions, if we see a block
    target for break or continue, we substitute the last expression of the
    block as the target instead.
    
    Two, break and continue were incorrectly being treated as the same, so
    continue would also show up as an exit from the loop or block. This
    patch corrects the way continue is handled by keeping a stack of loop
    entry points and uses those to find the target of the continue.
    eholk committed Feb 8, 2022
    Configuration menu
    Copy the full SHA
    c37a906 View commit details
    Browse the repository at this point in the history