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

RedefineClasses doesn't check for ConstantPool overflow

XMLWordPrintable

    • b10

      When merging constant pools, if the number of constant pool entries exceeds what fits in a u2, then you can't encode them in bytecodes.

      RedefineClasses append_entry doesn't check for u2 overflow.

      This code could check for overflow even though the actual merged constant pool could be smaller:

        // worst case merged constant pool length is old and new combined
        int merge_cp_length = the_class->constants()->length()
              + scratch_class->constants()->length();

            amenkov Alex Menkov
            coleenp Coleen Phillimore
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: