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

Fix calculating guard limit for nested loops #3

Open
mariopil opened this issue Nov 30, 2022 · 0 comments
Open

Fix calculating guard limit for nested loops #3

mariopil opened this issue Nov 30, 2022 · 0 comments
Assignees

Comments

@mariopil
Copy link
Collaborator

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);
        }
    }
}
@mariopil mariopil self-assigned this Nov 30, 2022
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