Question

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.

Was it helpful?

Solution

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...

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top