-
Enhancement
-
Resolution: Duplicate
-
P4
-
None
-
None
-
generic
-
generic
ADDITIONAL SYSTEM INFORMATION :
Ubuntu 22.04.2 LTS
openjdk version "20-internal" 2023-03-21
OpenJDK Runtime Environment (build 20-internal-adhoc.admin1.jdk-jdk-20-34)
OpenJDK 64-Bit Server VM (build 20-internal-adhoc.admin1.jdk-jdk-20-34, mixed mode)
A DESCRIPTION OF THE PROBLEM :
There seems to be a wrong error message when the IntVector.fromArray function is used with an array that is too small. For example, the attached code produces an IndexOutOfBoundsException: Index 0 out of bounds for length -4, which is not really helpful to resolve the issue. It would be good if the error message could clarify that the provided array is too small for the specified vector species. (The issue also occurs with other vector types.)
class Test{
public static void main(String args[]){
jdk.incubator.vector.IntVector vx = jdk.incubator.vector.IntVector.fromArray(jdk.incubator.vector.IntVector.SPECIES_256, new int[] { 0,1,2}, 0);
}
}
Ubuntu 22.04.2 LTS
openjdk version "20-internal" 2023-03-21
OpenJDK Runtime Environment (build 20-internal-adhoc.admin1.jdk-jdk-20-34)
OpenJDK 64-Bit Server VM (build 20-internal-adhoc.admin1.jdk-jdk-20-34, mixed mode)
A DESCRIPTION OF THE PROBLEM :
There seems to be a wrong error message when the IntVector.fromArray function is used with an array that is too small. For example, the attached code produces an IndexOutOfBoundsException: Index 0 out of bounds for length -4, which is not really helpful to resolve the issue. It would be good if the error message could clarify that the provided array is too small for the specified vector species. (The issue also occurs with other vector types.)
class Test{
public static void main(String args[]){
jdk.incubator.vector.IntVector vx = jdk.incubator.vector.IntVector.fromArray(jdk.incubator.vector.IntVector.SPECIES_256, new int[] { 0,1,2}, 0);
}
}
- duplicates
-
JDK-8277445 [vectorapi] Confusing index out of bounds message when loading a vector
- Open