Skip to content

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

@AdamMil

Description

@AdamMil

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions