From 94511d74d495bed63da81d742ea61ea6e1ccabf1 Mon Sep 17 00:00:00 2001 From: jgravelle-google Date: Mon, 24 Oct 2016 14:53:10 -0700 Subject: Update s2wasm for reordered call_indirect (#802) * Update s2wasm for reordered call_indirect https://reviews.llvm.org/D25708 fixed call_indirect for 0xc by reordering the operands. s2wasm needs to be aware of that too. * Update llvm_autogenerated tests * Update torture-s tests * run auto_update_tests * update handwritten dot_s test that had call_indirect with args --- src/s2wasm.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src') 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 operands(++input, inputs.end()); + auto* target = *(inputs.end() - 1); + std::vector 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)); -- cgit v1.2.3