summaryrefslogtreecommitdiff
path: root/src/wasm-js.cpp
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2016-08-16 14:54:01 -0700
committerAlon Zakai <alonzakai@gmail.com>2016-09-07 09:54:58 -0700
commit34d614a7e9026b793dd5b34d268fa7176d3771bd (patch)
tree6bbad1572bbea54b05b0d3d16e9629b62d886dbc /src/wasm-js.cpp
parent8014a63b064a497ee4c18a70500f89fa51f75c79 (diff)
downloadbinaryen-34d614a7e9026b793dd5b34d268fa7176d3771bd.tar.gz
binaryen-34d614a7e9026b793dd5b34d268fa7176d3771bd.tar.bz2
binaryen-34d614a7e9026b793dd5b34d268fa7176d3771bd.zip
call_indirect is now structural, so no need to pass the type name around
Diffstat (limited to 'src/wasm-js.cpp')
-rw-r--r--src/wasm-js.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/wasm-js.cpp b/src/wasm-js.cpp
index 66dcb4864..3c3c4eec7 100644
--- a/src/wasm-js.cpp
+++ b/src/wasm-js.cpp
@@ -255,7 +255,7 @@ extern "C" void EMSCRIPTEN_KEEPALIVE instantiate() {
return getResultFromJS(ret, import->type->result);
}
- Literal callTable(Index index, Name type, LiteralList& arguments, ModuleInstance& instance) override {
+ Literal callTable(Index index, LiteralList& arguments, WasmType result, ModuleInstance& instance) override {
void* ptr = (void*)EM_ASM_INT({
var value = Module['outside']['wasmTable'][$0];
return typeof value === "number" ? value : -1;
@@ -264,7 +264,6 @@ extern "C" void EMSCRIPTEN_KEEPALIVE instantiate() {
if (ptr != (void*)-1) {
// a Function we can call
Function* func = (Function*)ptr;
- if (func->type.is() && func->type != type) trap("callIndirect: bad type");
if (func->params.size() != arguments.size()) trap("callIndirect: bad # of arguments");
for (size_t i = 0; i < func->params.size(); i++) {
if (func->params[i] != arguments[i].type) {
@@ -281,7 +280,7 @@ extern "C" void EMSCRIPTEN_KEEPALIVE instantiate() {
Module['tempArguments'] = null;
return func.apply(null, tempArguments);
}, index);
- return getResultFromJS(ret, instance.wasm.getFunctionType(type)->result);
+ return getResultFromJS(ret, result);
}
}