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

Remove incorrect overflow check in RawBytecodeStream::raw_next

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 25
    • 25
    • hotspot
    • master

      We used to have this check:

      ```
      _bci = _next_bci;
      _next_bci += len;
      if (_next_bci <= _bci) { // Check for integer overflow
       // ...
      }
      ```

      But this code only runs within a branch which has checked `_bci <= _end_bci - len`, and if this is true then _next_bci can trivially be added without overflow check. So, let's remove the check.

            jsjolen Johan Sjölen
            jsjolen Johan Sjölen
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: