diff options
author | Alon Zakai <alonzakai@gmail.com> | 2016-03-21 12:46:38 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2016-03-21 12:46:38 -0700 |
commit | ff45fb37885b66a60b22e40eca41628b83cdc748 (patch) | |
tree | b246799c17329bdf54fe26f5e631f0e2936423a6 /src | |
parent | b3f029d8b3be1cfc74a035a6549f4ab2e62e9931 (diff) | |
parent | 3dd7f17b10a1c6d0de11f3fa297beb9b18016e38 (diff) | |
download | binaryen-ff45fb37885b66a60b22e40eca41628b83cdc748.tar.gz binaryen-ff45fb37885b66a60b22e40eca41628b83cdc748.tar.bz2 binaryen-ff45fb37885b66a60b22e40eca41628b83cdc748.zip |
Merge pull request #266 from WebAssembly/growth
Memory growth fixes
Diffstat (limited to 'src')
-rw-r--r-- | src/asm2wasm.h | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/asm2wasm.h b/src/asm2wasm.h index bf59d08ad..d6856c7f2 100644 --- a/src/asm2wasm.h +++ b/src/asm2wasm.h @@ -641,11 +641,17 @@ void Asm2WasmBuilder::processAsm(Ref ast) { for (unsigned k = 0; k < contents->size(); k++) { Ref pair = contents[k]; IString key = pair[0]->getIString(); - Ref value = pair[1]; - assert(value[0] == NAME); + assert(pair[1][0] == NAME); + IString value = pair[1][1]->getIString(); + if (key == Name("_emscripten_replace_memory")) { + // asm.js memory growth provides this special non-asm function, which we don't need (we use grow_memory) + assert(wasm.functionsMap.find(value) == wasm.functionsMap.end()); + continue; + } + assert(wasm.functionsMap.find(value) != wasm.functionsMap.end()); auto export_ = allocator.alloc<Export>(); export_->name = key; - export_->value = value[1]->getIString(); + export_->value = value; wasm.addExport(export_); } } |