wasm gc: fix infinite loop in type inference

This commit is contained in:
Alexey Andreev 2024-08-29 21:04:33 +02:00
parent 31d89ebec2
commit a0224f60e6

View File

@ -15,6 +15,7 @@
*/ */
package org.teavm.backend.wasm.gc; package org.teavm.backend.wasm.gc;
import java.util.Objects;
import org.teavm.model.ValueType; import org.teavm.model.ValueType;
public class PreciseValueType { public class PreciseValueType {
@ -25,4 +26,22 @@ public class PreciseValueType {
this.valueType = valueType; this.valueType = valueType;
this.isArrayUnwrap = isArrayUnwrap; this.isArrayUnwrap = isArrayUnwrap;
} }
@Override
public final boolean equals(Object o) {
if (this == o) {
return true;
}
if (!(o instanceof PreciseValueType)) {
return false;
}
var that = (PreciseValueType) o;
return isArrayUnwrap == that.isArrayUnwrap && valueType.equals(that.valueType);
}
@Override
public int hashCode() {
return Objects.hash(valueType, isArrayUnwrap);
}
} }