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

[vectorapi] Bounds checking issues when accessing memory segments

XMLWordPrintable

    • 19
    • b09
    • Verified

        The implementation of method VectorSpecies::fromMemorySegment, in AbstractSpecies::fromMemorySegment, neglects to perform bounds checks on the offset argument when the method is compiled by C2 (bounds checks are performed when interpreted and by C1).

        This is an oversight and explicit bounds checks are required, as is already case for the other load and store memory access methods (including storing to memory memory segments).

        The workaround is to call the static method {T}Vector::fromMemorySegment.

        The fix is for the implementation(s) of VectorSpecies::fromMemorySegment to do the same and call {T}Vector::fromMemorySegment, following the same pattern for implementations of VectorSpecies::fromArray.

              psandoz Paul Sandoz
              psandoz Paul Sandoz
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

                Created:
                Updated:
                Resolved: