[foreign-memaccess+abi] RFR: 8287516: Implement fallback Linker [v5]
Jorn Vernee
jvernee at openjdk.org
Fri Jan 20 14:25:04 UTC 2023
On Fri, 20 Jan 2023 13:08:48 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:
>> More specifically, if a struct has extra padding, then I wonder if libFFI could expect a struct size that is smaller than the size of the memory segment passed in by a Panama client (because that segment also has the extra padding). In our usual JDK-driven classification, we would take the struct, extract its field components and place them on registers and/or stack slots. But with libFFI, we just have to provide the struct segment in a buffer, which then libFFI will act upon - if there is a size mismatch there, I think it might have dire consequences?
>
> Anyway - I appreciate that the code verifies for mismatches. Good job. I was worried about the analysis being too "field-oriented", but you also look at offsets, so any extra padding should result in issues. Well, except maybe a trailing padding field?
The struct is passed to libffi in an array of pointers, so any trailing padding should simply be ignored.
-------------
PR: https://git.openjdk.org/panama-foreign/pull/770
More information about the panama-dev
mailing list