From 12f23b59acc5ce9bfbf48accc71f32f282371e00 Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Wed, 27 Dec 2023 15:41:42 +0000 Subject: Add note on value encoding --- .../compiler/backends/wasm/structure/binary/WasmBinaryWriter.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/main/java') diff --git a/src/main/java/org/shedlang/compiler/backends/wasm/structure/binary/WasmBinaryWriter.java b/src/main/java/org/shedlang/compiler/backends/wasm/structure/binary/WasmBinaryWriter.java index 614667da..4dc86a28 100644 --- a/src/main/java/org/shedlang/compiler/backends/wasm/structure/binary/WasmBinaryWriter.java +++ b/src/main/java/org/shedlang/compiler/backends/wasm/structure/binary/WasmBinaryWriter.java @@ -159,7 +159,10 @@ public class WasmBinaryWriter { } else if (unrelocatedIndex.isEmpty()) { throw new IllegalStateException("cannot write relocatable index outside of relocatable section"); } else { - // TODO: handle 64-bit values + // In principle, we should handle 64-bit values here. However, since + // the values we're encoding are only 32-bit, and we're not + // including any padding, encoding them as 32-bit values should be + // equivalent. if (relocationType.isSigned()) { writeSignedInt32(unrelocatedIndex.getAsInt()); } else { -- cgit v1.2.3