From a0599342ea4cb27223ceb27ba6d22e6476768d97 Mon Sep 17 00:00:00 2001 From: Nilstrieb <48135649+Nilstrieb@users.noreply.github.com> Date: Mon, 31 Jul 2023 16:51:54 +0200 Subject: [PATCH] fix offset --- src/wasm/wat.ts | 2 +- test.nil | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/wasm/wat.ts b/src/wasm/wat.ts index 4668726..551afad 100644 --- a/src/wasm/wat.ts +++ b/src/wasm/wat.ts @@ -215,7 +215,7 @@ function printBlockType(type: Blocktype, f: FmtCtx) { } function printMemarg(arg: MemArg, f: FmtCtx) { - if (arg.offset === undefined || arg.offset === 0) { + if (arg.offset !== undefined && arg.offset !== 0) { f.word(`offset=${arg.offset}`); } if (arg.align !== undefined) { diff --git a/test.nil b/test.nil index 1617fc6..f169233 100644 --- a/test.nil +++ b/test.nil @@ -66,4 +66,4 @@ function prInt(x: Int) = ( function println(s: String) = ( print(s); print("\n"); -); \ No newline at end of file +);