Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Wrong type when using wasm2wat or wasm-objdump to translate the Binaryen generated Wasm. #7299

Answered by tlively
Shawdox asked this question in Q&A
Discussion options

When I tried to use wasm2wat or wasm-objdump to translate the .wasm file (generated from ./scripts/fuzz_opt.py) to .wat format, I got the following errs:

  1. Using wasm2wat:
wasm2wat 1.wasm -o 1.wat
# 000000e: error: unexpected type form (got 0x5f)
  1. Using wasm-objdump:
wasm-objdump -d 1.wasm
# 5.wasm: file format wasm 0x1
# 0000017: error: expected valid param type (got -0x1d)
# 000063d: error: invalid section code: 14
# 000079e: error: invalid global type: 0xffffffe4
# 00015a2: error: expected valid local type
# ...

Since the Wasm generated by Binaryen is valid and free from undefined behaviors, I am a little bit puzzled why this happened. I've attached the target wasm file and did I get something wrong or it is normal?
Wasm file: 1.zip

You must be logged in to vote

wasm2wat and wasm-objdump do not know about WasmGC type definitions. I would recommend using wasm-tools (https://github.com/bytecodealliance/wasm-tools) to do your wasm-to-wat conversions instead.

Replies: 1 comment 1 reply

Comment options

wasm2wat and wasm-objdump do not know about WasmGC type definitions. I would recommend using wasm-tools (https://github.com/bytecodealliance/wasm-tools) to do your wasm-to-wat conversions instead.

You must be logged in to vote
1 reply
Comment options

Answer selected by Shawdox
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants

AltStyle によって変換されたページ (->オリジナル) /