Fix memory layout generation for struct parameters #251

Merged
jwharm merged 1 commit from fix-memory-layout into main 2025-07-20 22:23:24 +02:00
jwharm commented 2025-07-20 22:23:14 +02:00 (Migrated from github.com)

When a struct is passed by value to a native function, we have to set the struct's memory layout in the FunctionDescriptor, not ValueLayout.ADDRESS.

This means we can't use simple strings ("ADDRESS", "JAVA_INT" etc.) to represent the memory layout anymore, because we need to include things like "typeName:T.getMemoryLayout()". So the relevant functions have been changed everywhere to use PartialStatements that maintain the relevant type information.

When a struct is passed by value to a native function, we have to set the struct's memory layout in the FunctionDescriptor, not ValueLayout.ADDRESS. This means we can't use simple strings ("ADDRESS", "JAVA_INT" etc.) to represent the memory layout anymore, because we need to include things like "typeName:T.getMemoryLayout()". So the relevant functions have been changed everywhere to use PartialStatements that maintain the relevant type information.
Sign in to join this conversation.
No description provided.