summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorjgravelle-google <jgravelle@google.com>2016-10-24 14:53:10 -0700
committerGitHub <noreply@github.com>2016-10-24 14:53:10 -0700
commit94511d74d495bed63da81d742ea61ea6e1ccabf1 (patch)
tree698a31871f6d80cebcde2f1fb301ecdc9c55225c /src
parentf4900d69e884f7a40468c4084907bb87405984db (diff)
downloadbinaryen-94511d74d495bed63da81d742ea61ea6e1ccabf1.tar.gz
binaryen-94511d74d495bed63da81d742ea61ea6e1ccabf1.tar.bz2
binaryen-94511d74d495bed63da81d742ea61ea6e1ccabf1.zip
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
Diffstat (limited to 'src')
-rw-r--r--src/s2wasm.h5
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));