summaryrefslogtreecommitdiff
path: root/src/wasm2asm.h
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2016-04-27 19:25:15 -0700
committerAlon Zakai <alonzakai@gmail.com>2016-04-27 19:25:15 -0700
commit6a6bdc1cef5ec35cb9f7caf6e10ec76ee1107d0d (patch)
tree9ed1b23b55c86f8fa1aee285bfdde9d47c2f1ae8 /src/wasm2asm.h
parent4a85f62e8a83117a081e9691d8830b6a7a876d1d (diff)
parentf0a4f15dc27ffff9505503a8168854b7662b2657 (diff)
downloadbinaryen-6a6bdc1cef5ec35cb9f7caf6e10ec76ee1107d0d.tar.gz
binaryen-6a6bdc1cef5ec35cb9f7caf6e10ec76ee1107d0d.tar.bz2
binaryen-6a6bdc1cef5ec35cb9f7caf6e10ec76ee1107d0d.zip
Merge pull request #403 from WebAssembly/leaks
Fix leaks and enable leak checks
Diffstat (limited to 'src/wasm2asm.h')
-rw-r--r--src/wasm2asm.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/wasm2asm.h b/src/wasm2asm.h
index 82eb0b1a9..e0b071f9b 100644
--- a/src/wasm2asm.h
+++ b/src/wasm2asm.h
@@ -205,8 +205,8 @@ Ref Wasm2AsmBuilder::processWasm(Module* wasm) {
asmFunc[3]->push_back(ValueBuilder::makeStatement(ValueBuilder::makeString(USE_ASM)));
// create heaps, etc
addBasics(asmFunc[3]);
- for (auto import : wasm->imports) {
- addImport(asmFunc[3], import);
+ for (auto& import : wasm->imports) {
+ addImport(asmFunc[3], import.get());
}
// figure out the table size
tableSize = wasm->table.names.size();
@@ -216,8 +216,8 @@ Ref Wasm2AsmBuilder::processWasm(Module* wasm) {
}
tableSize = pow2ed;
// functions
- for (auto func : wasm->functions) {
- asmFunc[3]->push_back(processFunction(func));
+ for (auto& func : wasm->functions) {
+ asmFunc[3]->push_back(processFunction(func.get()));
}
addTables(asmFunc[3], wasm);
// memory XXX
@@ -320,7 +320,7 @@ void Wasm2AsmBuilder::addTables(Ref ast, Module *wasm) {
void Wasm2AsmBuilder::addExports(Ref ast, Module *wasm) {
Ref exports = ValueBuilder::makeObject();
- for (auto export_ : wasm->exports) {
+ for (auto& export_ : wasm->exports) {
ValueBuilder::appendToObject(exports, fromName(export_->name), ValueBuilder::makeName(fromName(export_->value)));
}
ast->push_back(ValueBuilder::makeStatement(ValueBuilder::makeReturn(exports)));