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

Compilation fails due to field accesses on array types

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 9
    • 8u40, 9
    • hotspot
    • None
    • b106

      Compilation of bytecodes that reference fields of array types fails. So, for example, compiling a method that contains a bytecode like

       0: getstatic #18 // Field "[C".field1:I

      will trigger various asserts; both the C1 and C2 compilers are affected.

      The problem is that both compilers assume that field accesses can target only instance types (and not array types). However, arrays can be also seen as a instance types, as arrays are a subclass of java.lang.Object.

      Code like the example shown above is not typically generated by the static java compiler, but it can possibly be generated with custom bytecode-generating tools.

            zmajo Zoltan Majo (Inactive)
            zmajo Zoltan Majo (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: