wabt icon indicating copy to clipboard operation
wabt copied to clipboard

unexpected opcode: 0x18

Open kiwenlau opened this issue 3 years ago • 1 comments

I use wasm2wat demo with all features enabled:

截屏2021-10-15 08 20 07

The .wasm file is attatched:

a.out.wasm.zip

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.

kiwenlau avatar Oct 15 '21 00:10 kiwenlau

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.

takikawa avatar Oct 27 '21 16:10 takikawa

I believe this has been updated.

keithw avatar Aug 17 '22 05:08 keithw