jakarta-bcel-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 18323] New: - Size of LDC_W's operand can be incorrect
Date Tue, 25 Mar 2003 15:43:25 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=18323>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=18323

Size of LDC_W's operand can be incorrect

           Summary: Size of LDC_W's operand can be incorrect
           Product: BCEL
           Version: unspecified
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Main
        AssignedTo: bcel-dev@jakarta.apache.org
        ReportedBy: nova@to.email.ne.jp


When MethodGen read LDC_W whose index is less than 256 and dumps it, the size of
its operand becomes incorrect.

LDC_W's setIndex method can change both the opcode and the length.
But after the invocation initFromFile method change the opcode OR the length.
And its dump method determines the operand's size by the length.
As a result that can make a mismatch b/w an opcode and an operand.

LDC_W.java 1.1.1.1 and 1.3 has this problem.

A scenario(in case of LDC_W.java 1.3):
1. Suppose a LDC_W whose index is less than 256
2. initFromFile method sets the opcode to LDC_W and the length to 2.
3. dump method writes a LDC_W but it writes a byte as the operand.

I think that 1.2 has no problem.
Another solution is as follows.

--- LDC_W.java.1.1.1.1  Sat Dec 15 21:40:41 2001
+++ LDC_W.java  Wed Mar 26 00:36:01 2003
@@ -82,6 +82,6 @@
        throws IOException
   {
     setIndex(bytes.readUnsignedShort());
-    length = 3;
+    //length = 3;
   }
 }

---------------------------------------------------------------------
To unsubscribe, e-mail: bcel-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: bcel-dev-help@jakarta.apache.org


Mime
View raw message