Christian Collberg
Department of Computer Science
University of Arizona
ON condition statementThis statement is not actually executed. It's just ``remembered'' until later, should an error occur.
ON OVERFLOW GOTO error; ... error: PRINT "something bad happened"
... ON OVERFLOW PRINT "use smaller numbers, please!" ... A := A*1000000000000;
1#1
4#4
5#5
6#6
class StuipdError extends Exception {}
throw new StupidError("Forgot to buy milk!")
class Throwable {}
class Exception extends Throwable {}
class InterruptedException extends Exception {}
class RuntimeException extends Exception {}
class ArithmeticException extends RuntimeException {}
class NullPointerException extends RuntimeException {}
class ClassCastException extends RuntimeException {}
class Error extends Throwable {}
class ThreadDeath extends Error {}
try {
throw new Exception("They were out of milk!")
} catch (StupidError e) {
...
} catch (Exception e) {
...
} catch (Throwable e) {
...
}
try {
throw new Exception("They were out of milk!")
} catch (StupidError e) {
getACow();
} finally {
eatCornFlakes();
}
|
8#8 |
9#9 |
10#10 |
11#11
12#12
if (!setjmp(buffer)) {
/* setjmp returned 0. Protected code.*/
...
longjmp(buffer);
...
} else {
/* setjmp returned 1. Handler code. */
}