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

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

    XMLWordPrintable

    Details

    • Type: Enhancement
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 9
    • Fix Version/s: 10
    • Component/s: hotspot
    • Labels:
    • Subcomponent:
    • Resolved In Build:
      b21

      Description

      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).

        Attachments

          Activity

            People

            Assignee:
            hseigel Harold Seigel
            Reporter:
            vlivanov Vladimir Ivanov
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: