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

Remove array-related access checks from Reflection::verify_class_access()

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P4 P4
    • 10
    • 9
    • hotspot
    • b21

      The following code is unreachable:

      src/share/vm/runtime/reflection.cpp:
          if (new_class->is_objArray_klass()) {
            new_class = ObjArrayKlass::cast(new_class)->bottom_klass();
          }
          if (!new_class->is_instance_klass()) {
            // Everyone can read a typearray.
            assert (new_class->is_typeArray_klass(), "Unexpected klass type");
            return ACCESS_OK;
          }

      new_class in Reflection::verify_class_access() can never be an array klass: all callers either pass an instance klass or pre-process arrays (use element klass for object arrays and bypass the call for primitive arrays).

            hseigel Harold Seigel (Inactive)
            vlivanov Vladimir Ivanov
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: