mirror of
https://github.com/corda/corda.git
synced 2025-06-13 04:38:19 +00:00
don't abort when compiling an array lookup with a constant negative index
Instead, just compile it as a direct call to the thunk which throws an ArrayIndexOutOfBoundsException.
This commit is contained in:
@ -15,6 +15,17 @@ public class Arrays {
|
||||
expect(exception != null);
|
||||
}
|
||||
|
||||
{ int[] array = new int[0];
|
||||
Exception exception = null;
|
||||
try {
|
||||
int x = array[-1];
|
||||
} catch (ArrayIndexOutOfBoundsException e) {
|
||||
exception = e;
|
||||
}
|
||||
|
||||
expect(exception != null);
|
||||
}
|
||||
|
||||
{ int[] array = new int[3];
|
||||
int i = 0;
|
||||
array[i++] = 1;
|
||||
|
Reference in New Issue
Block a user