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

LIR_Opr::vreg_number() and data() can return negative number

    XMLWordPrintable

    Details

    • Subcomponent:
    • Resolved In Build:
      b26

      Backports

        Description

        This code seems wrong:

        uintptr_t data() const { return value() >> data_shift; }

        It's doing a signed shift, so the sign bit is going to be extended into the unsigned result, giving a value that is too large.

        In JDK-8261235, non_data_bits was changed to work around this problem, but the real problem is the sign bit. non_data_bits should not count pointer_bits because pointer_bits is actually included in kind_bits (see JDK-8287288).

          Attachments

            Issue Links

              Activity

                People

                Assignee:
                dlong Dean Long
                Reporter:
                dlong Dean Long
                Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                  Dates

                  Created:
                  Updated:
                  Resolved: