CodeQL library for C/C++
codeql/cpp-all 0.12.12-dev (changelog, source)
Search

Member predicate GotoStmt::breaksFromNestedLoops

Holds if this ‘goto’ statement breaks out of two or more nested loops.

For example, for

while(b) {
    while(b) {
        if(b) goto middle;
        if(b) goto end;
    }
    if(b) goto end;
middle:
}
end:

this holds for the second goto, but not the first or third.

predicate breaksFromNestedLoops()