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

[vector] IndexOutOfBoundsException for fromArray/intoArray with unset mask lanes

    Details

      Description

      IndexOutOfBoundsException may be thrown for fromArray/intoArray/gather/scatter API with unset mask lanes.

      To align with API doc, IndexOutOfBoundsException should only be thrown for any illegal vector lane index where the mask at lane is set.

      E.g. The following Gather API implementation should not throw IndexOutOfBoundsException when vector lane index is larger than a.length where the mask at lane is unset.

          public static LongVector fromArray(LongSpecies species, long[] a, int i, Mask<Long> m, int[] indexMap, int j)
          {
              // @@@ This can result in out of bounds errors for unset mask lanes
              return zero(species).blend(fromArray(species, a, i, indexMap, j), m);
          }

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                psandoz Paul Sandoz
                Reporter:
                jzhu Joshua Zhu
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: