diff options
Diffstat (limited to 'src/main/java')
| -rw-r--r-- | src/main/java/org/shedlang/compiler/backends/wasm/WasmTarget.java | 7 |
1 files changed, 7 insertions, 0 deletions
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; } |
