From 410c7a1ab1b78cc906166942a679991eaf3e1525 Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Tue, 26 Dec 2023 23:48:29 +0000 Subject: Add TODO --- src/main/java/org/shedlang/compiler/backends/wasm/WasmTarget.java | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/main/java') diff --git a/src/main/java/org/shedlang/compiler/backends/wasm/WasmTarget.java b/src/main/java/org/shedlang/compiler/backends/wasm/WasmTarget.java index c53f9779..6c3dec78 100644 --- a/src/main/java/org/shedlang/compiler/backends/wasm/WasmTarget.java +++ b/src/main/java/org/shedlang/compiler/backends/wasm/WasmTarget.java @@ -63,6 +63,13 @@ public enum WasmTarget { } public WasmValueType functionPointerType() { + // TODO: there's a problem here: wasm64 uses 32-bit function pointers, + // but C uses void* for all pointers, which will be 64-bit on wasm64. + // We could either: + // * Change the C definition of a closure to use a 32-bit int, and cast + // it to a void* on use, or + // * Change the Wasm backend to treat Patio function pointers as 64-bit, + // and convert from 32-bit to 64-bit when referencing table indices. return WasmValueType.I32; } -- cgit v1.2.3