Skip to content

Commit c0977d3

Browse files
authored
document that binaryen text is not valid wasm text, but stack IR is [ci skip] (#1716)
1 parent 77c6602 commit c0977d3

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,10 @@ There are a few differences between Binaryen IR and the WebAssembly language:
7171
* WebAssembly limits block/if/loop types to none and the concrete value types
7272
(i32, i64, f32, f64). Binaryen IR has an unreachable type, and it allows
7373
block/if/loop to take it, allowing [local transforms that don't need to
74-
know the global context][unreachable].
74+
know the global context][unreachable]. As a result, Binaryen's default
75+
text output is not necessarily valid wasm text. (To get valid wasm text,
76+
you can do `--generate-stack-ir --print-stack-ir`, which prints Stack IR,
77+
this is guaranteed to be valid for wasm parsers.)
7578
* Binaryen ignores unreachable code when reading WebAssembly binaries. That
7679
means that if you read a wasm file with unreachable code, that code will be
7780
discarded as if it were optimized out (often this is what you want anyhow,

0 commit comments

Comments
 (0)