Skip to content

For loop postprocessing can drop the increment expression (?) #29

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

Open
AdamMil opened this issue Feb 4, 2019 · 0 comments
Open

For loop postprocessing can drop the increment expression (?) #29

AdamMil opened this issue Feb 4, 2019 · 0 comments

Comments

@AdamMil
Copy link

AdamMil commented Feb 4, 2019

It looks like the for loop postprocessing code can drop the increment statement in one case:

StatementPtr incrementStatement = GetForIncrementStatement();
if ((prevStatement->GetType() != Stat_LocalVar) && !incrementStatement)
    return  StatementPtr();

GetForIncrementStatement actually removes the increment statement from the block, and then if it doesn't get used (because GetType() == Stat_LocalVar), I believe it just disappears.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant