wasm2js does not support 64-bit memories
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 48/100
Research direction
Reproduce the failure with the shown clang --target=wasm64 command and wasm2js on add.wasm. Start by tracing the i64-to-i32-lowering pass and its validation output; done means the wasm64 input translates without load/store pointer type validation errors.
Written by the indexing model from the issue text.
Description
For C++ source code,
extern "C" int add (int first, int second)
{
return first + second;
}
Compiling with clang-15 with wasm64 target,
clang --target=wasm64 --no-standard-libraries -Wl,--export-all -Wl,--no-entry -o add.wasm add.cc
And translate to js using wasm2js,
wasm2js add.wasm
However it fails with
[PassRunner] running pass: i64-to-i32-lowering... 0.0005889 seconds. [PassRunner] (validating) [PassRunner] running nested passes [PassRunner] running pass: ... 0.0002939 seconds. [PassRunner] nested passes took 0.0002939 seconds.
[wasm-validator error in function add] i32 != i64: store pointer must match memory index type, on
(i32.store offset=12
(block (result i32)
(local.set $40
(local.get $20)
)
(local.get $19)
)
(local.get $21)
)
[wasm-validator error in function add] i32 != i64: store pointer must match memory index type, on
(i32.store offset=8
(block (result i32)
(local.set $37
(local.get $23)
)
(local.get $22)
) (local.get $24) )
[wasm-validator error in function add] i32 != i64: load pointer type must match memory index type, on
(i32.load offset=12
(block (result i32)
(local.set $35
(local.get $26)
)
(local.get $25)
)
)
[wasm-validator error in function add] i32 != i64: load pointer type must match memory index type, on
(i32.load offset=8
(block (result i32)
(local.set $38
(local.get $29)
)
(local.get $28)
)
)
- Dominant language
- WebAssembly
- Stars
- 8.6k
- Forks
- 885
- Avg merge
- 2d 1h
- Merged PRs (30d)
- 70
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.
More from WebAssembly/binaryen
-
Difficulty 2/5 Half a day Newbie friendliness 76/100
WebAssembly/binaryen#9018 · 3 comments ·
-
Difficulty 4/5 3-5 days Newbie friendliness 52/100
WebAssembly/binaryen#9123 ·
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
WebAssembly/binaryen#9122 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
WebAssembly/binaryen#9086 · 2 comments ·
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
WebAssembly/binaryen#9038 · 5 comments ·
All issues in WebAssembly/binaryen
Similar issues
-
compiler/runtime
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
objectionary/eo#8869 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
EricSpencer00/Resilient#4824 · 1 comment ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
objectionary/jeo-maven-plugin#1758 ·
-
generics
Difficulty 2/5 1-3 hours Newbie friendliness 82/100