summaryrefslogtreecommitdiff
path: root/src/wasm-s-parser.h
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2015-11-05 17:37:59 -0800
committerAlon Zakai <alonzakai@gmail.com>2015-11-05 17:37:59 -0800
commit9f375280e1168645ba9be9a6b5889c58ebcf565a (patch)
treed279915d87c79de254281db404426172ee4445ae /src/wasm-s-parser.h
parent46393bd1004c8fd679394ceaf0d64d1d5c3c616c (diff)
downloadbinaryen-9f375280e1168645ba9be9a6b5889c58ebcf565a.tar.gz
binaryen-9f375280e1168645ba9be9a6b5889c58ebcf565a.tar.bz2
binaryen-9f375280e1168645ba9be9a6b5889c58ebcf565a.zip
remember function type name, for later checks
Diffstat (limited to 'src/wasm-s-parser.h')
-rw-r--r--src/wasm-s-parser.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/wasm-s-parser.h b/src/wasm-s-parser.h
index 5a394fa4c..2f86fcef2 100644
--- a/src/wasm-s-parser.h
+++ b/src/wasm-s-parser.h
@@ -278,6 +278,7 @@ private:
func->result = stringToWasmType(curr[1]->str());
} else if (id == TYPE) {
Name name = curr[1]->str();
+ func->type = name;
if (wasm.functionTypesMap.find(name) == wasm.functionTypesMap.end()) onError();
FunctionType* type = wasm.functionTypesMap[name];
func->result = type->result;
@@ -306,7 +307,7 @@ private:
func->params = typeParams;
}
if (!func->body) func->body = allocator.alloc<Nop>();
- wasm.functions.push_back(func);
+ wasm.addFunction(func);
currLocalTypes.clear();
}