summaryrefslogtreecommitdiff
path: root/src/wasm-interpreter.h
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2016-06-03 14:21:02 -0700
committerAlon Zakai <alonzakai@gmail.com>2016-06-03 14:21:02 -0700
commitb76818e23eab75876f1981800ef12d55ce2f579b (patch)
treed57a02368f8ee2cc4747f6805943623f290a3397 /src/wasm-interpreter.h
parent1826f4132d52a1c767f012fad5d1ab3e746e632b (diff)
parent74bc353d4fedd9fff308aecfae183b6b7525c7d3 (diff)
downloadbinaryen-b76818e23eab75876f1981800ef12d55ce2f579b.tar.gz
binaryen-b76818e23eab75876f1981800ef12d55ce2f579b.tar.bz2
binaryen-b76818e23eab75876f1981800ef12d55ce2f579b.zip
Merge pull request #567 from WebAssembly/spec-test-update
Misc fixes for new spec tests
Diffstat (limited to 'src/wasm-interpreter.h')
-rw-r--r--src/wasm-interpreter.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/wasm-interpreter.h b/src/wasm-interpreter.h
index 0ee2aff78..82ead1d8f 100644
--- a/src/wasm-interpreter.h
+++ b/src/wasm-interpreter.h
@@ -359,6 +359,10 @@ private:
LiteralList arguments;
Flow flow = generateArguments(curr->operands, arguments);
if (flow.breaking()) return flow;
+ if (func->params.size() != arguments.size()) trap("callIndirect: bad # of arguments");
+ for (size_t i = 0; i < func->getNumLocals(); i++) {
+ if (func->params[i] != arguments[i].type) trap("callIndirect: bad argument type");
+ }
return instance.callFunctionInternal(name, arguments);
}