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,6 +128,9 @@ public class WasmGCTypeMapper {
} }
} }
if (result == null) { if (result == null) {
if(className.equals(Address.class.getName())) {
typeCache.put(className, WasmType.INT32);
}else {
var cls = classes.get(className); var cls = classes.get(className);
if (cls == null) { if (cls == null) {
className = "java.lang.Object"; className = "java.lang.Object";
@ -135,6 +139,7 @@ public class WasmGCTypeMapper {
typeCache.put(className, result); typeCache.put(className, result);
} }
} }
}
return result; return result;
} }