-
Bug
-
Resolution: Fixed
-
P3
-
21
-
b22
Any combination of structure members that have a "small" element before a "longer" element causes IAE:
jshell> var ml = MemoryLayout.structLayout(ValueLayout.JAVA_LONG, ValueLayout.JAVA_BYTE, ValueLayout.JAVA_INT);
| Exception java.lang.IllegalArgumentException: Invalid alignment constraint for member layout: i32
| at StructLayoutImpl.of (StructLayoutImpl.java:49)
| at MemoryLayout.lambda$structLayout$1 (MemoryLayout.java:746)
| at MemoryLayout.wrapOverflow (MemoryLayout.java:766)
| at MemoryLayout.structLayout (MemoryLayout.java:745)
| at do_it$Aux (#10:1)
| at (#10:1)
jshell> var ml = MemoryLayout.structLayout(ValueLayout.JAVA_BYTE, ValueLayout.JAVA_SHORT);
| Exception java.lang.IllegalArgumentException: Invalid alignment constraint for member layout: s16
| at StructLayoutImpl.of (StructLayoutImpl.java:49)
| at MemoryLayout.lambda$structLayout$1 (MemoryLayout.java:746)
| at MemoryLayout.wrapOverflow (MemoryLayout.java:766)
| at MemoryLayout.structLayout (MemoryLayout.java:745)
| at do_it$Aux (#3:1)
| at (#3:1)
jshell> var ml = MemoryLayout.structLayout(ValueLayout.JAVA_LONG, ValueLayout.JAVA_BYTE, ValueLayout.JAVA_INT);
| Exception java.lang.IllegalArgumentException: Invalid alignment constraint for member layout: i32
| at StructLayoutImpl.of (StructLayoutImpl.java:49)
| at MemoryLayout.lambda$structLayout$1 (MemoryLayout.java:746)
| at MemoryLayout.wrapOverflow (MemoryLayout.java:766)
| at MemoryLayout.structLayout (MemoryLayout.java:745)
| at do_it$Aux (#10:1)
| at (#10:1)
jshell> var ml = MemoryLayout.structLayout(ValueLayout.JAVA_BYTE, ValueLayout.JAVA_SHORT);
| Exception java.lang.IllegalArgumentException: Invalid alignment constraint for member layout: s16
| at StructLayoutImpl.of (StructLayoutImpl.java:49)
| at MemoryLayout.lambda$structLayout$1 (MemoryLayout.java:746)
| at MemoryLayout.wrapOverflow (MemoryLayout.java:766)
| at MemoryLayout.structLayout (MemoryLayout.java:745)
| at do_it$Aux (#3:1)
| at (#3:1)
- csr for
-
JDK-8307335 MemoryLayout.structLayout uses undocumented strict alignment constraints
-
- Closed
-