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

Load that bypasses arraycopy has wrong memory state

XMLWordPrintable

    • b66
    • b176
    • Verified

        Following 2 tests currently fail because the load of dst[1] bypasses the arraycopy to load from src but uses the wrong memory state.
            static int test3(int[] src) {
                int[] dst = new int[10];
                System.arraycopy(src, 0, dst, 0, 10);
                src[1] = 0x42;
                return dst[1];
            }

            static int test4(int[] src) {
                int[] dst = (int[])src.clone();
                src[1] = 0x42;
                return dst[1];
            }

              roland Roland Westrelin
              roland Roland Westrelin
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

                Created:
                Updated:
                Resolved: