Skip to content

Fix calculating guard limit for nested loops #3

Open
@mariopil

Description

@mariopil

Currently nested loops are handled in isolation - for each of them guard limit is calculated separately. This should be fixed, for each nested loop guard limit should be multiplied, e.g.

uint8_t acc[20];

for (int i = 0; _g(__LINE__, 11), i < 10; ++i)
{
    for (int j = 0; _g(__LINE__, 30), j < 2; ++j)
    {
        for (int k = 0; _g(__LINE__, 120),  k < 5; ++k)
        {
            hook_account(acc, 20);
        }
        for (int k = 0; _g(__LINE__, 120),  k < 5; ++k)
        {
            hook_account(acc, 20);
        }
    }
}

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions