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

VarHandle::get() throws unexpected IllegalArgumentException

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P3
    • 22
    • 21, 22
    • core-libs
    • None

    Description

      VarHandle::get() when supplied with a corrupt segment (misaligned or empty), an IllegalArgumentException is being thrown. IllegalArgumentException is not mentioned in the api doc for VarHandle::get()

        MemorySegment segment = confinedArena.allocate(someLayout);
                  MemorySegment segment1 = MemorySegment.ofAddress(segment.address() + 1); //corruptSegment
                  …
        VarHandle vh_x = layout1.varHandle(PathElement.sequenceElement(), PathElement.groupElement("x"));
       
      // vh_x.set(segment, 0, 1.1);
        vh_x.get(segment1, 0);

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: