On Thu, 1 Dec 2022 17:53:02 GMT, Maurizio Cimadamore <mcimadam...@openjdk.org> 
wrote:

>> Yes, I mean the layout of the underlying value that is being accessed. i.e. 
>> can't access a boolean as an int.
>> 
>> The behavior is undefined either way. Even when a VaList is created from 
>> Java, we create the same underlying native data structure (because we want 
>> to pass it to native code). This doesn't keep track of the layouts the list 
>> was built with, so there can still be mismatches.
>
> Right.

This sentence still needs to be clarified IMHO. E.g. it is not clear when 
reading what "using a memory layout other than the layout of the accessed 
value" - since we are passing a layout to the access operation... it feels like 
we're trying to compress too much. We should say something like:


The values in a variable argument list are stored in one or more regions of 
memory in a platform specific fashion. 
Any attempt to access (or skip) any such value with a mismatched memory layout 
(example) will result in undefined behavior.

-------------

PR: https://git.openjdk.org/jdk/pull/11440

Reply via email to