Make Address class compile to an i32

This commit is contained in:
lax1dude 2024-11-01 22:01:27 -07:00
parent 0d8baace3d
commit f62a80a1d8

View File

@ -24,6 +24,7 @@ import org.teavm.backend.wasm.model.WasmModule;
import org.teavm.backend.wasm.model.WasmPackedType; import org.teavm.backend.wasm.model.WasmPackedType;
import org.teavm.backend.wasm.model.WasmStorageType; import org.teavm.backend.wasm.model.WasmStorageType;
import org.teavm.backend.wasm.model.WasmType; import org.teavm.backend.wasm.model.WasmType;
import org.teavm.interop.Address;
import org.teavm.model.ClassReaderSource; import org.teavm.model.ClassReaderSource;
import org.teavm.model.MethodDescriptor; import org.teavm.model.MethodDescriptor;
import org.teavm.model.ValueType; import org.teavm.model.ValueType;
@ -127,12 +128,16 @@ public class WasmGCTypeMapper {
} }
} }
if (result == null) { if (result == null) {
var cls = classes.get(className); if(className.equals(Address.class.getName())) {
if (cls == null) { typeCache.put(className, WasmType.INT32);
className = "java.lang.Object"; }else {
var cls = classes.get(className);
if (cls == null) {
className = "java.lang.Object";
}
result = classInfoProvider.getClassInfo(className).getType();
typeCache.put(className, result);
} }
result = classInfoProvider.getClassInfo(className).getType();
typeCache.put(className, result);
} }
} }
return result; return result;