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 +);