DO NOT REPLY [Bug 29903] New: - LDC_W emits output with only one parameter byte
| Newsgroups | gmane.comp.jakarta.bcel.devel |
|---|---|
| Message-ID | <[email protected]> |
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=29903>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND
INSERTED IN THE BUG DATABASE.
http://issues.apache.org/bugzilla/show_bug.cgi?id=29903
LDC_W emits output with only one parameter byte
Summary: LDC_W emits output with only one parameter byte
Product: BCEL
Version: unspecified
Platform: All
OS/Version: Other
Status: NEW
Severity: Major
Priority: Other
Component: Main
AssignedTo: [email protected]
ReportedBy: [email protected]
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;
}
}