Skip to content

Commit

Permalink
Throw correct ArrayIndexOutOfBoundsException in System.arraycopy.
Browse files Browse the repository at this point in the history
  • Loading branch information
mukel committed Nov 19, 2019
1 parent 443594d commit c92def1
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ private static void doArraycopy(Object fromArray, int fromIndex, Object toArray,

private static void boundsCheck(Object fromArray, int fromIndex, Object toArray, int toIndex, int length) {
if (fromIndex < 0 || toIndex < 0 || length < 0 || fromIndex > KnownIntrinsics.readArrayLength(fromArray) - length || toIndex > KnownIntrinsics.readArrayLength(toArray) - length) {
throw new IndexOutOfBoundsException();
throw new ArrayIndexOutOfBoundsException();
}
}

Expand Down

0 comments on commit c92def1

Please sign in to comment.