-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Closed
Labels
arch-wasm32-bit and 64-bit WebAssembly32-bit and 64-bit WebAssemblybugObserved behavior contradicts documented or intended behaviorObserved behavior contradicts documented or intended behaviorfrontendTokenization, parsing, AstGen, Sema, and Liveness.Tokenization, parsing, AstGen, Sema, and Liveness.
Milestone
Description
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 ...
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
arch-wasm32-bit and 64-bit WebAssembly32-bit and 64-bit WebAssemblybugObserved behavior contradicts documented or intended behaviorObserved behavior contradicts documented or intended behaviorfrontendTokenization, parsing, AstGen, Sema, and Liveness.Tokenization, parsing, AstGen, Sema, and Liveness.