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

Type.getReturnTypeSize() doesn't decode Type.getTypeSize() output

    XMLWordPrintableJSON

    Details

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

      Description

      The Type.getReturnTypeSize() method doesn't decode Type.getTypeSize() output.

      The same bug was present in FieldInstruction.getFieldSize(), filed and fixed as BCEL-138 https://issues.apache.org/bugzilla/show_bug.cgi?id=48280

      As a result of this bug, the BCEL calculates the wrong size of the return type for methods, leading to FindBugs going off the rails.

      The fix is the same as to fix FieldInstruction.getFieldSize(): use Type.size() to decode the coded value.
      I've attached a patch with the fix, and I've also looked at the other uses of getTypeSize(), and all the other invocations seem OK.

        Attachments

        1. fixForReturnTypeSize.txt
          0.5 kB
          William Pugh

          Activity

            People

            • Assignee:
              issues@commons.apache.org Apache Commons Developers
              Reporter:
              pugh@cs.umd.edu William Pugh
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: