[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

'equivTo' and locals




It is fairly easy, and in fact, relatively benign to create local
variables that have the same name and the same type.  The code
creates valid class files, and runs fine, since the name and type
of locals doesn't really have any semantic meaning when it comes
to the bytecode.

However, The CommonSubexpressionEliminator creates incorrect code
when this happens, because it uses equivTo and thinks the locals
are the same, even if they are distinct. 

I'd suggest just using instance equality for the equivTo method
of Locals, (or at least making the CSE smart enough to figure out when
it is being stupid...)

Steve