Uploaded image for project: 'Harmony'
  1. Harmony
  2. HARMONY-6555

[dvrlm][testing][vmtt] VMTT throws exception if custom attributes are semantically incorrrect though syntactically correct

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: DRLVM
    • Labels:
      None
    • Environment:
      all

      Description

      /* VMTT -C expects custom attributes to be semantically correct (name index points to UTF8 constant pool element), otherwise fails with exception.

      • Try to compile this test.
        */
        magic = xCAFEBABE

      minor_version = 0

      major_version = 50

      constant_pool_count = 17

      constant_pool {
      /* #1 */ UTF8 = "java/lang/Object"
      /* #2 */ Class = #13
      /* #3 */ Class = #1
      /* #4 */ UTF8 = "ok"
      /* #5 */ UTF8 = "I"
      /* #6 */ UTF8 = "bar"
      /* #7 */ UTF8 = "Ljava/lang/Object;"
      /* #8 */ UTF8 = "<init>"
      /* #9 */ UTF8 = "()I"
      /* #10 */ UTF8 = "Code"
      /* #11 */ UTF8 = "test"
      /* #12 */ NameAndType = #4 #5
      /* #13 */ UTF8 = "CustomAttr"
      /* #14 */ Field = #2 #12
      /* #15 */ UTF8 = "ConstantValue"
      /* #16 */ int = 104
      }

      access_flags = x21 // PUBLIC SUPER

      this_class = #2 // "CustomAttr"

      super_class = #3 // "java/lang/Object"

      interfaces_count = 0

      interfaces {
      }

      fields_count = 1

      fields {
      field {
      access_flag = x08 // STATIC
      name_index = #4 // "ok"
      descriptor_index = #5 // "I"
      attributes_count = 2
      attributes {
      attribute

      { // wrong name_index (not UTF8) x00 x10 x00 x00 x00 x02 x00 x00 }

      attribute

      { // wrong name_index (out of range) x00 x11 x00 x00 x00 x02 x00 x00 }

      }
      }
      }

      methods_count = 1

      methods {
      method {
      access_flag = x09 // PUBLIC STATIC
      name_index = #11 // "test"
      descriptor_index = #9 // "()I"
      attributes_count = 1
      attributes {
      attribute Code {
      attribute_name_index = #10 // "Code"
      attribute_length = 16
      max_stack = 1
      max_locals = 0
      code_length = 4
      code asm

      { 0: sipush 104 3: ireturn }

      exception_table_length = 0
      attributes_count = 0
      }
      }
      }
      }

      attributes_count = 0

        Attachments

        1. CustomAttr.ccode
          2 kB
          Alexei Kaigorodov

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              rfq Alexei Kaigorodov
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated: