You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Current hooks-guard-in-for clang-tidy check only looks at for loops in isolation. It should also take into account their nesting, so that when it proposes to insert a call to _g, it computes its second argument not just as this loop iterations + 1, but as (this loop iterations + 1) * (each parent loop's iteration's), 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);
}
}
}
while also recognizing when the computation cannot be done (e.g. when the loops have dynamic limits).
The text was updated successfully, but these errors were encountered:
Current
hooks-guard-in-for
clang-tidy check only looks at for loops in isolation. It should also take into account their nesting, so that when it proposes to insert a call to_g
, it computes its second argument not just as this loop iterations + 1, but as (this loop iterations + 1) * (each parent loop's iteration's), e.g.while also recognizing when the computation cannot be done (e.g. when the loops have dynamic limits).
The text was updated successfully, but these errors were encountered: