-
Bug
-
Resolution: Fixed
-
P3
-
19
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8290285 | 20 | Maurizio Cimadamore | P3 | Resolved | Fixed | b07 |
JDK-8291422 | 19.0.2 | Maurizio Cimadamore | P3 | Resolved | Fixed | b01 |
JDK-8291297 | 19.0.1 | Maurizio Cimadamore | P3 | Resolved | Fixed | b04 |
The spec : https://download.java.net/java/early_access/jdk19/docs/api/java.base/java/lang/foreign/SegmentAllocator.html#allocate(java.lang.foreign.MemoryLayout)
"Throws:
IllegalArgumentException - if count < 0."
Expecting the below code shall throw IAEx.
try {
SegmentAllocator.implicitAllocator().allocateArray(ValueLayout.JAVA_BYTE, -1);
}catch (IllegalArgumentException ex){
System.out.println("OK - Expected Exception ");
}catch (Exception ex){
System.out.println("NOT OK - exception thrown is "+ex.getMessage());
}
Actual Result :
java.lang.OutOfMemoryError: Cannot reserve 1152921504606846975 bytes...
Note - For other negative numbers the implementation throws IAEx.
"Throws:
IllegalArgumentException - if count < 0."
Expecting the below code shall throw IAEx.
try {
SegmentAllocator.implicitAllocator().allocateArray(ValueLayout.JAVA_BYTE, -1);
}catch (IllegalArgumentException ex){
System.out.println("OK - Expected Exception ");
}catch (Exception ex){
System.out.println("NOT OK - exception thrown is "+ex.getMessage());
}
Actual Result :
java.lang.OutOfMemoryError: Cannot reserve 1152921504606846975 bytes...
Note - For other negative numbers the implementation throws IAEx.
- backported by
-
JDK-8290285 SegmentAllocator:allocateArray(MemoryLayout, count) does not throw IAEx when count is -1
-
- Resolved
-
-
JDK-8291297 SegmentAllocator:allocateArray(MemoryLayout, count) does not throw IAEx when count is -1
-
- Resolved
-
-
JDK-8291422 SegmentAllocator:allocateArray(MemoryLayout, count) does not throw IAEx when count is -1
-
- Resolved
-
- relates to
-
JDK-8282192 Implementation of Foreign Function & Memory API (Preview)
-
- Closed
-
(1 links to)