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

[lworld] Improper layout computation of classes with empty value field

XMLWordPrintable

      Consider this class:

      value class Empty {}

      value class EmptyEmpty {
          @NullRestricted
          Empty e;
      }

      Then, EmptyEmpty is incorrectly calculated to have the size of 1. If it is contained in a class:

      class Holder1 {
          @NullRestricted
          EmptyEmpty e;
          byte b;
      }

      Then Holder1 will have the field b at offset 13.

        1. Test.java
          0.4 kB
          Tobias Hartmann

            fparain Frederic Parain
            qamai Quan Anh Mai
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: