Uploaded image for project: 'Commons BCEL'
  1. Commons BCEL
  2. BCEL-151

Code attribute size not updated

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: 5.3
    • Fix Version/s: 6.0
    • Component/s: Main
    • Labels:
      None

      Description

      The code attribute length when dumped is not updated, and as such will write the old size of the attribute should the size of the actual byte code change.

      A possible fix is adding:
      "setLength(calculateLength());"

      to the first line of:
      org.apache.bcel.classfile.Code.dump(DataOutputStream) throws IOException

      When trying to execute code that has this error, it throws a ClassFormatException, Wrong code segment length (Should there be no other formatting errors with the code).

        Attachments

          Activity

            People

            • Assignee:
              issues@commons.apache.org Apache Commons Developers
              Reporter:
              glenchat@gmail.com Glen Chatfield
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: