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

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

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

Comments

Projects
None yet
1 participant
@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