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

Remove unnecessary/confusing null check in Verifier::verify()

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Unresolved
    • Icon: P4 P4
    • None
    • None
    • hotspot
    • None

      This null check was added in JDK-8059924

      https://github.com/openjdk/jdk/blame/f52d35c84b7333809156d201c866793854143888/src/hotspot/share/classfile/verifier.cpp#L159-L170

        if (klass->java_mirror() != NULL) {
          klass->java_mirror()->identity_hash();
        }

      However, class verification happens only during class linking. At this point, all classes should have a valid mirror.

      I tested with "java -Xshare:off -Xverify:all". Evern "early" classes link java.lang.Object have a non-null mirror when they are verified.

      The null check implies that we could pass a null pointer into the inference verifier, causing a subsequent crash. But this will never happen in reality.

      The null check should be removed with an assert to avoid the confusion.

            Unassigned Unassigned
            iklam Ioi Lam
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: