wabt
wabt copied to clipboard
unexpected opcode: 0x18
I use wasm2wat demo with all features enabled:

The .wasm file is attatched:
I got the .wasm by compile following .cpp
#include <stdio.h>
int main() {
try {
puts("throw...");
throw 1;
} catch(...) {
puts("catch!");
}
return 0;
}
I compile cpp with fwasm-exceptions flag
emcc test.cpp -fwasm-exceptions
I use emcc 2.0.31 on macbook
emcc --version
emcc (Emscripten gcc/clang-like replacement + linker emulating GNU ld) 2.0.31 (4fcbf0239ccca29771f9044c990b0d34fac6e2e7)
Copyright (C) 2014 the Emscripten authors (see AUTHORS.txt)
This is free and open source software under the MIT license.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
I think the issue might be that libwabt.js
for the demo hasn't been rebuilt in a while: https://github.com/WebAssembly/wabt/blob/main/docs/demo/libwabt.js
It should work if you build wasm2wat
locally with a recent wabt though.
I believe this has been updated.