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

JNI_GetPrimitiveArrayCritical() should not accept object array

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 18
    • 18
    • hotspot
    • b06

      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.

        1. libTestPinnedGarbage.c
          1 kB
          Zhengyu Gu
        2. TestPinnedGarbage.java
          0.6 kB
          Zhengyu Gu

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

              Created:
              Updated:
              Resolved: