mirror of
https://github.com/github/codeql.git
synced 2026-04-28 18:25:24 +02:00
Merge pull request #13528 from rdmarsh2/rdmarsh2/cpp/range-analysis-back-edge
C++: fix range analysis back edge detection for irreducible CFGs
This commit is contained in:
@@ -70,3 +70,27 @@ int f4(int x) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// No interesting ranges to check here - this irreducible CFG caused an infinite loop due to back edge detection
|
||||
void gotoLoop(bool b1, bool b2)
|
||||
{
|
||||
int j;
|
||||
|
||||
if (b1)
|
||||
return;
|
||||
|
||||
if (!b2)
|
||||
{
|
||||
for (j = 0; j < 10; ++j)
|
||||
{
|
||||
goto main_decode_loop;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (j = 0; j < 10; ++j)
|
||||
{
|
||||
main_decode_loop:
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user