Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8252759

Jextract flattens nested anonymous structs and unions when computing layouts

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: repo-panama
    • Fix Version/s: None
    • Component/s: tools

      Description

      For layouts such as these:

          struct Foo {
              int x;
              union {
                  int y;
                  int z;
              };
          };

      Jextract will generate:

          static final MemoryLayout Foo$struct$LAYOUT_ = MemoryLayout.ofStruct(
              C_INT.withName("x"),
              C_INT.withName("y"),
              C_INT.withName("z")
          ).withName("Foo");

      We should change the layout generation to not flatten layouts of nested anonymous structs into their parents.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              jvernee Jorn Vernee
              Reporter:
              jvernee Jorn Vernee
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: