RFR: 8238837: AArch64: TestUpcall failures after JDK-8237358

Nick Gasson ngasson at openjdk.java.net
Tue Feb 11 11:28:10 UTC 2020


The binding interpreter changes in JDK-8237358 cause a failure on
AArch64 when a struct parameter whose size is not a multiple of 8 is
spilled to the stack. Because the generated bindings dereference the
struct as a series of Java longs, the final long read will read past the
end of the MemorySegment.

Fix by dereferencing using a type that is appropriate for the size to
copy. E.g. long for 8 bytes, int for 4 bytes, etc.

Tested jdk_foreign on aarch64 and x86_64.

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

Commits:
 - de505497: 8238837: AArch64: TestUpcall failures after JDK-8237358

Changes: https://git.openjdk.java.net/panama-foreign/pull/13/files
 Webrev: https://webrevs.openjdk.java.net/panama-foreign/13/webrev.00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8238837
  Stats: 8 lines in 2 files changed: 2 ins; 0 del; 6 mod
  Patch: https://git.openjdk.java.net/panama-foreign/pull/13.diff
  Fetch: git fetch https://git.openjdk.java.net/panama-foreign pull/13/head:pull/13

PR: https://git.openjdk.java.net/panama-foreign/pull/13


More information about the panama-dev mailing list