RFR: 7903609: Jextract can not handle some anonymous nested structs [v2]

Maurizio Cimadamore mcimadamore at openjdk.org
Wed Dec 13 18:09:11 UTC 2023


On Wed, 13 Dec 2023 16:54:12 GMT, Jorn Vernee <jvernee at openjdk.org> wrote:

>> src/main/java/org/openjdk/jextract/impl/TreeMaker.java line 343:
>> 
>>> 341:      * };
>>> 342:      */
>>> 343:     private static OptionalLong offsetOfAnonymousRecord(Cursor outermostParent, Cursor anonRecord, Cursor record) {
>> 
>> What about DeclarationImpl::recordMemberOffset ? Is that still used? UnsupportedTypeFilter and StructBuilder depend on that for skipping - is is still the case that the anon record offset might be missing?
>
> yes, it's still used. The offset of an anon struct might be missing if it doesn't have any named fields nested inside. In that case, the offset is OptionalLong.empty(), and the UnsupportedFilter adds a Skip to the record: https://github.com/openjdk/jextract/blob/e790205da93c4aacd8524064d0f109d637b99161/src/main/java/org/openjdk/jextract/impl/UnsupportedFilter.java#L231-L233

Uhm - but shouldn't that function use the new attribute that you set?

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

PR Review Comment: https://git.openjdk.org/jextract/pull/159#discussion_r1425711322


More information about the jextract-dev mailing list