Skip to content
Draft
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 on lines 129 to 132
int argIndex = 0;
int argOffset;
Expand Down Expand Up @@ -195,6 +196,12 @@ protected override void EmitCode(NodeFactory factory, ref Wasm.WasmEmitter instr
wasmLocalIndex++;
}

if (hasRetBuffArg)
{
// FIXME: What do I do here?
wasmLocalIndex++;
}

for (int i = 0; i < methodSignature.Length; i++)
{
TypeDesc paramType = methodSignature[i];
Expand Down Expand Up @@ -302,6 +309,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