Details
-
Bug
-
Resolution: Fixed
-
P2
-
22
-
None
-
b24
-
Verified
Description
If a sequence layout contains an element type with `byteSize()` zero, the SequenceLayout::toString method will throw an ArithmeticException (division by zero).
Reproduce:
@Test
public void testSequenceLayoutWithZeroLength() {
SequenceLayout layout = MemoryLayout.sequenceLayout(0, JAVA_INT);
assertEquals(layout.toString(), "[0:i4]");
SequenceLayout nested = MemoryLayout.sequenceLayout(0, layout);
assertEquals(nested.toString(), "[0:[0:i4]]"); // <- Fails!
}
Reproduce:
@Test
public void testSequenceLayoutWithZeroLength() {
SequenceLayout layout = MemoryLayout.sequenceLayout(0, JAVA_INT);
assertEquals(layout.toString(), "[0:i4]");
SequenceLayout nested = MemoryLayout.sequenceLayout(0, layout);
assertEquals(nested.toString(), "[0:[0:i4]]"); // <- Fails!
}
Attachments
Issue Links
- relates to
-
JDK-8319966 AIX: expected [[0:i4]] but found [[0:I4]] after JDK-8319882
-
- Resolved
-