diff options
Diffstat (limited to 'src/s2wasm.h')
-rw-r--r-- | src/s2wasm.h | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/s2wasm.h b/src/s2wasm.h index 6f2eb05c5..1e52cfbce 100644 --- a/src/s2wasm.h +++ b/src/s2wasm.h @@ -896,9 +896,8 @@ class S2WasmBuilder { Name assign = getAssign(); int num = getNumInputs(); auto inputs = getInputs(num); - auto input = inputs.begin(); - auto* target = *input; - std::vector<Expression*> operands(++input, inputs.end()); + auto* target = *(inputs.end() - 1); + std::vector<Expression*> operands(inputs.begin(), inputs.end() - 1); auto* funcType = ensureFunctionType(getSig(type, operands), wasm); assert(type == funcType->result); auto* indirect = builder.makeCallIndirect(funcType, target, std::move(operands)); |