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

C2 replaces range checks by unsigned comparison with -1

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 9
    • Fix Version/s: 9
    • Component/s: hotspot
    • Labels:
      None
    • Subcomponent:
    • Resolved In Build:
      b84

      Backports

        Description

        The range check optimization introduced by JDK-8073480 replaces checks of the form (i < 0 && i > length - 1) with an unsigned comparison of i and (length - 1). If length is 0, i is compared to -1 and the range check does *not* fail.

        Applying the attached patch to TestBadFoldCompare.java reproduces the problem.

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  roland Roland Westrelin
                  Reporter:
                  thartmann Tobias Hartmann
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  3 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: