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

MemoryLayout API checks should be more eager

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P3 P3
    • None
    • repo-panama
    • core-libs

      The MemoryLayout API allows ill-formed layout to be constructed w/o errors. For instance:

      ```
      structLayout(JAVA_INT, JAVA_LONG)
      ```

      This struct layout is missing a 32-bit padding between the two elements. But no exception is produced. Instead, an exception is given when a var handle pointing to the second field is constructed.

      This is undesirable, as it can lead to latent bugs.

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

              Created:
              Updated:
              Resolved: