Skip to content

CFG analysis puzzlers

Jean-Noël Rouvignac edited this page Oct 1, 2016 · 4 revisions

Code samples

Infinite loop 1

while  (true) {
    try {
        break;
    } finally {
        continue;
    }
}

Only one iteration

while  (true) {
    try {
        System.exit(0);
    } finally {
        continue;
    }
}

Infinite loop 2

for (byte b = Byte.MIN_VALUE; b <= MAX_VALUE; b++) {
    // infinite loop
}