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

C2 replaces range checks by unsigned comparison with -1

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 9
    • 9
    • hotspot
    • None
    • b84

        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.

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

                Created:
                Updated:
                Resolved: