C++: fix range analysis back edge detection for irreducible CFGs

This commit is contained in:
Robert Marsh
2023-06-21 17:54:52 -04:00
committed by Robert Marsh
parent 9c774ac97f
commit ba7cb8f4ae
2 changed files with 39 additions and 0 deletions

View File

@@ -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:
}
}
}