/*
Test4
WARNING THIS PROGRAM NEVER ENDS DUE TO JAVA COMPILER ERROR
Neither Sun JDK 1.1.8 nor JDK 1.4.1 compiler will output *any* error or warning
A disassembly of the class file shows no reference to the readyInst label.
Friday, March 19th, 2004
Mark A. Washburn
*/
public class Test4 {
final static short m[] = {
-1, -2, -3,
};
static boolean bGone = false;
public static void main(String args[]) {
long inst = 0;
short ip = 0;
exitInterpreter:
while (!bGone) {
try {
while (true) {
inst = m[ip++];
System.out.print(" inst = " + inst + "\n");
readyInst: {
switch (-((short) inst)) {
case 1:
break;
case 2:
break;
case 3:
inst = -4;
if (inst < 0) {
break readyInst;
}
break;
case 4:
bGone = true;
continue exitInterpreter;
default:
break;
}
}
}
} catch (Exception e) {// array out of bounds error
// System.out.print("\nException: " + e.toString() + "\n" );
}
}
System.out.print
(" Your compiler resolved the /break readyInst;/ statement.\n");
}
}