analysis.Frame.merge() should use ! .equals() instead of !=
In the asm.tree.analysis.Frame class:
in method:
public boolean merge(final Frame<? extends V> frame, final Interpreter<V>
interpreter)
there is code of the form:
for (int i = 0; i < locals + top; ++i) {
V v = interpreter.merge(values[i], frame.values[i]);
if (v != values[i])
note that the line:
if (v != values[i])
should instead be:
if (! v.equals(values[i]))
otherwise if an interpreter returns a value using 'new', eg - new
ExpressionValue(), this method will always detect a change and go in an
infinite loop.
Whats more interesting is that the other overloaded merge method in the same
class does indeed use the equals() method:
boolean merge(final Frame<? extends V> frame, final boolean[] access)
for (int i = 0; i < locals; ++i) {
if (!access[i] && !values[i].equals(frame.values[i])) {
I dont see any good logic behind using != instead of !.equals() in the previous
method, when you do use .equals() in this one. It breaks interpreters who use
'new' to return values.