WebAssembly / WebAssembly/wabt
wasm-decompile decompile error
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 8.1k
- Forks
- 827
- Avg merge
- 4d 6h
- Merged PRs (30d)
- 18
Description
Hi wabt team,
Recently I have been testing the decompile tool chain of WebAssembly. This is conducted by comparing the results of a C program:
- compile into WASM, decompile with
wasm-decompile, rewrite syntax and re-compile into native binary. - directly compile into native binary.
A few execution discrepancies are discovered during this process.
One is as the displayed code snipped. It seems like the recovered data flow is incorrect.
May I ask if this is an implementation error, or am I missing anything here?
Attaching the files related to this report. 198.zip
198.c: A C program generated with csmith. The goal is to compare the final hash value after executingfunc_1.198is the compiled WASM198_wasm-decompile.c: Decompiled result by wasm-decompile.198_new.c: Extract the decompiledfunc_1in198_wasm-decompile.cand fix the syntax to make it re-compilable
Thank you
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the discrepancy with the attached 198.c, 198, 198_wasm-decompile.c, and 198_new.c files using wasm-decompile. Compare the recovered data flow and final hash against the original C program, then determine whether the discrepancy is an implementation error and document a minimal reproducible case if confirmed.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c, cpp, wasm
- Domain
- compilers, tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100