Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ protected override void EmitCode(NodeFactory factory, ref Wasm.WasmEmitter instr

int[] offsets = new int[methodSignature.Length];
bool[] isIndirectStructArg = new bool[methodSignature.Length];
bool hasRetBuffArg = _wasmSignature.SignatureString[0] == 'S';

Comment thread
kg marked this conversation as resolved.
int argIndex = 0;
int argOffset;
Expand Down Expand Up @@ -195,6 +196,11 @@ protected override void EmitCode(NodeFactory factory, ref Wasm.WasmEmitter instr
wasmLocalIndex++;
}

if (hasRetBuffArg)
{
wasmLocalIndex++;
}

for (int i = 0; i < methodSignature.Length; i++)
Comment thread
kg marked this conversation as resolved.
{
TypeDesc paramType = methodSignature[i];
Expand Down Expand Up @@ -302,6 +308,13 @@ protected override void EmitCode(NodeFactory factory, ref Wasm.WasmEmitter instr
wasmLocalIndex++;
}

// Pass return buffer argument if needed
if (hasRetBuffArg)
{
expressions.Add(Local.Get(wasmLocalIndex));
wasmLocalIndex++;
}

for (int i = 0; i < methodSignature.Length; i++)
{
TypeDesc paramType = methodSignature[i];
Expand Down
Loading