Uploaded image for project: 'Code Tools'
  1. Code Tools
  2. CODETOOLS-7903481

Jextract doesn't enforce group layout alignment correctly in some cases

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • None
    • None
    • tools

      Consider this case:

      #pragma pack(push, 1)
      struct A {
         long long a;
         int b;
      };
      #pragma pack(pop)

      struct B {
         struct A x[1];
      };

      In this case, jextract doesn't work as expected. The size of the struct A is 12 bytes, which is NOT a multiple of the struct alignment (8). As a result, when we try to create a sequence layout with A as element layout, we get an exception.

            mcimadamore Maurizio Cimadamore
            mcimadamore Maurizio Cimadamore
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: