try {
- p("NegativeArraySizeException:");
+ p("NegativeArraySizeException (newarray):");
int[] ia = new int[-1];
failed();
} catch (NegativeArraySizeException e) {
}
try {
- p("NegativeArraySizeException:");
+ p("NegativeArraySizeException (newarray):");
int[] ia = new int[-1];
failed();
} catch (NegativeArraySizeException e) {
pstacktrace(e);
}
+ try {
+ p("NegativeArraySizeException (multianewarray):");
+ int[][] ia = new int[1][-1];
+ failed();
+ } catch (NegativeArraySizeException e) {
+ ok();
+ pstacktrace(e);
+ }
+
try {
p("NullPointerException (only w/ -softnull):");
pstacktrace(e);
}
+ try {
+ p("OutOfMemoryError (multianewarray):");
+ /* 100 MB should be enough */
+ byte[][] ba = new byte[10 * 1024 * 1024][10 * 1024 * 1024];
+ failed();
+ } catch (OutOfMemoryError e) {
+ ok();
+ pstacktrace(e);
+ }
+
pln();