On Mon, 30 Nov 2026 18:39:01 GMT, Jorn Vernee <[email protected]> wrote:

> See the JBS issue.
> 
> This patch makes sure to only align the stack offset for struct arguments 
> passed on the stack, when we are actually passing the argument on the stack. 
> This ensures subsequent arguments that need to be packed are placed at the 
> correct stack offset.
> 
> I've added a new test that tests this exact scenario as well.
> 
> ---------
> - [x] I confirm that I make this contribution in accordance with the [OpenJDK 
> Interim AI Policy](https://openjdk.org/legal/ai).

test/jdk/java/foreign/NativeTestHelper.java line 227:

> 225:                 MemoryLayout.PathElement fieldPath = 
> groupElement(fieldIdx);
> 226:                 fieldChecks.add(initField(random, segment, struct, 
> fieldLayout, fieldPath, allocator));
> 227:             }

I've changed the code here a bit to not rely on the field layout having a name. 
The previous code failed when trying to generate a test value for a struct 
layout with an unnamed field.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/34130#discussion_r4743772003

Reply via email to