RyanLamansky / dotnet-webassembly

Create, read, modify, write and execute WebAssembly (WASM) files from .NET-based applications.
Apache License 2.0
792 stars 73 forks source link

Emit Call To Imported Function #50

Closed furesoft closed 2 years ago

furesoft commented 2 years ago

I try to make a compiler for webassembly and want to call a external function.

`

    exprBody.Add(new Int32Constant(42));

    exprBody.Add(new Int32Constant(125));

    exprBody.Add(new Call(1));

    exprBody.Add(new End());`

but I get an error: End requires at 1 value on the stack, found 3

the call never executes. the function definition of the external function is index 1 and the function is imported in the module