Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
None
-
None
Description
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
}