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

LDC_W emits output with only one parameter byte

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 5.2
    • Main
    • None

    Description

      Fixing this took me half a day

      See this patch:

      Index: LDC_W.java
      ===================================================================
      RCS file: /home/cvspublic/jakarta-bcel/src/java/org/apache/bcel/generic/LDC_W.java,v
      retrieving revision 1.4
      diff -u -r1.4 LDC_W.java
      — LDC_W.java 23 May 2003 07:55:17 -0000 1.4
      +++ LDC_W.java 3 Jul 2004 20:02:10 -0000
      @@ -82,7 +82,12 @@
      throws IOException

      { setIndex(bytes.readUnsignedShort()); + /* + This is wrong!! (and thus commented out) + An LDC_W, which has got opcode LDC because index<256, may not change the opcode to LDC_W back, + because then it would emit an LDC_W opcode with only ONE byte as parameter, leading to class file corruption. + */ // Override just in case it has been changed - opcode = org.apache.bcel.Constants.LDC_W; + // opcode = org.apache.bcel.Constants.LDC_W; }

      }

      Attachments

        1. patch
          0.8 kB
          development--2006--issues.apache.org
        2. patch
          0.8 kB
          development--2006--issues.apache.org

        Activity

          People

            issues@commons.apache.org Apache Commons Developers
            development--2006--issues.apache.org@medium.net development--2006--issues.apache.org
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: