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

US_ASCII decoder relies on String.decodeASCII being exhaustive

XMLWordPrintable

      https://bugs.openjdk.java.net/browse/JDK-8281146 changed String.decodeASCII to be implemented using StringCoding.countPositives, which due to issues with implementation complexity was implemented on aarch64 so that the intrinsic may return a value less than the actual leading positive bytes.

      This causes an issue in US_ASCII.Decoder.decodeArrayLoop which assumes that String.decodeASCII exhaustively decodes all bytes from the source. This is manifesting in our CI as an intermittent error in tools/javac/unicode/Unmappable.java. A simple fix is to ensure this assumption holds by adding a loop to drain any remaining ASCII bytes from the source array in String.decodeASCII.

            redestad Claes Redestad
            redestad Claes Redestad
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: