Zig Version
0.10.0-dev.4060+61aaef0b0
Steps to Reproduce
- Create two files that both import a function of the same name, but with different module names
- Import two files into a 3rd one and call both functions.
- Make webassembly build
- Decompile webassembly
- Observe the declared import functions
a.zig
pub extern "a" fn hello() i32;
b.zig
pub extern "b" fn hello() i32;
double-hello.zig
const a = @import("a.zig");
const b = @import("b.zig");
extern "env" fn out(value: i32) void;
export fn doubleHello() void {
out(a.hello());
out(b.hello());
}
build command zig build-lib double-hello.zig -target wasm32-freestanding -dynamic
decompile double-hello.wasm using https://webassembly.github.io/wabt/demo/wasm2wat/
Expected Behavior
In decompiled wasm, expected two hello functions.
(import "a" "hello" (func $a_hello ...
(import "b" "hello" (func $b_hello ...
Actual Behavior
In decompiled wasm, only found a.hello
(import "a" "hello" (func $hello ...
Zig Version
0.10.0-dev.4060+61aaef0b0
Steps to Reproduce
a.zigb.zigdouble-hello.zigbuild command
zig build-lib double-hello.zig -target wasm32-freestanding -dynamicdecompile
double-hello.wasmusing https://webassembly.github.io/wabt/demo/wasm2wat/Expected Behavior
In decompiled wasm, expected two hello functions.
Actual Behavior
In decompiled wasm, only found a.hello