C2_MacroAssembler::verify_int_in_range has incorrect early return condition

XMLWordPrintable

    • Type: Bug
    • Resolution: Unresolved
    • Priority: P4
    • 27
    • Affects Version/s: 26
    • Component/s: hotspot

      The early return is:

        if (t == TypeInt::INT) {
          return;
        }

      The following code then expects t._lo != min_jint || t._hi != max_jint:

        if (lo != min_jint && hi != max_jint) {
          subsw(rtmp, rval, lo);
          br(Assembler::LT, L_failure);
          subsw(rtmp, rval, hi);
          br(Assembler::LE, L_success);
        } else if (lo != min_jint) {
          subsw(rtmp, rval, lo);
          br(Assembler::GE, L_success);
        } else if (hi != max_jint) {
          subsw(rtmp, rval, hi);
          br(Assembler::LE, L_success);
        } else {
          ShouldNotReachHere();
        }

      The early return condition should be:

        if (lo == min_jint && hi == max_jint)

      We should also verify the value with unsigned bounds and bits, but this issue only concerns with this potential crash.

            Assignee:
            Quan Anh Mai
            Reporter:
            Quan Anh Mai
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: