File tree 1 file changed +7
-0
lines changed
src/java.base/share/classes/java/lang/foreign
1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change 52
52
* As such, this interface only supports reading {@code int}, {@code double},
53
53
* and any other type that fits into a {@code long}.
54
54
* <h2 id="safety">Safety considerations</h2>
55
+ * Accessing a value through a variable argument list using the wrong memory layout will result in undefined behavior.
56
+ * For instance, if a variable argument list currently points at a C {@code int} value, then accessing it using
57
+ * {@link #nextVarg(ValueLayout.OfLong)} is illegal. Similarly, accessing the variable argument list with
58
+ * {@link #skip(MemoryLayout...)}, and providing a layout other than {@link ValueLayout.OfInt} is illegal.
59
+ * Any such illegal accesses might not be detected by the implementation, and can corrupt the variable argument list,
60
+ * so that the behavior of subsequent accesses is also undefined.
61
+ * <p>
55
62
* It is possible for clients to access elements outside the spatial bounds of a variable argument list.
56
63
* Variable argument list implementations will try to detect out-of-bounds reads on a best-effort basis.
57
64
* <p>
You can’t perform that action at this time.
0 commit comments