I was using javap
to study the code produced for one of my classes and noticed the following output:
...
frame_type = 255 /* full_frame */
offset_delta = 11
locals = [ class Test, double, int, double, double, bogus, bogus, int, int, class "[D" ]
stack = []
...
What is the meaning of those "bogus" type/variable entries in the locals
table? How are they caused? What is their impact on the resulting code?
The class file was produced using the Eclipse 3.7 compiler and javap
came from OpenJDK-1.6b22.
I came upon this little gem while going over the Javassist documentation:
BOGUS
public static final Type BOGUS
Represents a non-accessible value. Code cannot access the value this type represents. It occurs when bytecode reuses a local variable table position with non-mergable types. An example would be compiled code which uses the same position for a primitive type in one branch, and a reference type in another branch.
I presume that this ambiguity is what causes the "bogus" entries in the locals
table as well...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With