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

JNI_GetPrimitiveArrayCritical() should not accept object array

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 18
    • Fix Version/s: 18
    • Component/s: hotspot
    • Labels:
    • Subcomponent:
    • Resolved In Build:
      b06

      Description

      GetPrimitiveArrayCritical() can only be used with primitive array types, but logic in JNI_GetPrimitiveArrayCritical() makes it looks like possible for object array.

      BasicType type;
        if (a->is_objArray()) {
          type = T_OBJECT;
        } else {
          type = TypeArrayKlass::cast(a->klass())->element_type();
        }

      and I can pass in object array to GetPrimitiveArrayCritical() without any complains. See attached test case for details.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              zgu Zhengyu Gu
              Reporter:
              zgu Zhengyu Gu
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: