diff --git a/classlib/src/main/java/org/teavm/classlib/impl/record/ObjectMethodsSubstitutor.java b/classlib/src/main/java/org/teavm/classlib/impl/record/ObjectMethodsSubstitutor.java index b41477a8c..e87b3dc79 100644 --- a/classlib/src/main/java/org/teavm/classlib/impl/record/ObjectMethodsSubstitutor.java +++ b/classlib/src/main/java/org/teavm/classlib/impl/record/ObjectMethodsSubstitutor.java @@ -56,7 +56,7 @@ public class ObjectMethodsSubstitutor implements BootstrapMethodSubstitutor { pe.jump(joint); }); ConditionProducer classCondition = () -> thatVar.isNull() - .or(() -> thatVar.invokeVirtual("getClass", Class.class).isNotSame(pe.constant(type))); + .or(() -> thatVar.invokeSpecial("getClass", Class.class).isNotSame(pe.constant(type))); pe.when(classCondition).thenDo(() -> { pe.constant(0).propagateTo(result); pe.jump(joint);