corda/test/StackOverflow.java
Joel Dice d18240cbd6 check for stack overflow on entry to all non-leaf methods
We now check for stack overflow in the JIT build as well as the
interpreted build, throwing a StackOverflowError if the limit
(currently hard-coded to 64KB, but should be easy to make
configurable) is exceeded.
2010-12-19 15:23:19 -07:00

30 lines
491 B
Java

public class StackOverflow {
private static void test1() {
test1();
}
private static void test2() {
test3();
}
private static void test3() {
test2();
}
public static void main(String[] args) {
try {
test1();
throw new RuntimeException();
} catch (StackOverflowError e) {
e.printStackTrace();
}
try {
test2();
throw new RuntimeException();
} catch (StackOverflowError e) {
e.printStackTrace();
}
}
}