[foreign-jextract] Integrated: 8254983: jextract fails to hande layout paths nested structs/union
Maurizio Cimadamore
mcimadamore at openjdk.java.net
Tue Oct 20 09:32:33 UTC 2020
On Mon, 19 Oct 2020 16:35:56 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:
> This patch fixes an issue with jextract code generation. More specifically, when multiple structs with same name are
> found in an header (this is possible if the structs are at different level of nesting e.g. `Foo.Bar` vs.
> `Foo.Baz.Bar`), jextract erroneously uses the struct simple name to qualifiy the various fields associated with the
> struct (such as the layout field). Because of this, there are cases where, when generating a var handle for a struct
> field, we erroneously pick up the layout corresponding to a different struct, which then causes an error at runtime.
> The fix is to always disambiguate struct names when in nested context, so that `Foo.Bar` and `Foo.Baz.Bar` lead to
> different constant names.
This pull request has now been integrated.
Changeset: d841b847
Author: Maurizio Cimadamore <mcimadamore at openjdk.org>
URL: https://git.openjdk.java.net/panama-foreign/commit/d841b847
Stats: 135 lines in 6 files changed: 119 ins; 5 del; 11 mod
8254983: jextract fails to hande layout paths nested structs/union
Reviewed-by: jvernee, sundar
-------------
PR: https://git.openjdk.java.net/panama-foreign/pull/384
More information about the panama-dev
mailing list