diff options
author | Alon Zakai <alonzakai@gmail.com> | 2016-10-11 16:15:15 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-10-11 16:15:15 -0700 |
commit | 85900965a12a3f07c9cca8ef620d4bee039f16fc (patch) | |
tree | 184203f372600d547705ce3d11b616d52ad522aa /src/asm2wasm.h | |
parent | 1dbdfff8e997f74154dfebce124756e415aa431a (diff) | |
parent | 943fd287247f9d23d463a24e8eb4b0f666900c43 (diff) | |
download | binaryen-85900965a12a3f07c9cca8ef620d4bee039f16fc.tar.gz binaryen-85900965a12a3f07c9cca8ef620d4bee039f16fc.tar.bz2 binaryen-85900965a12a3f07c9cca8ef620d4bee039f16fc.zip |
Merge pull request #757 from WebAssembly/js-api
Tiny fixes for native wasm support
Diffstat (limited to 'src/asm2wasm.h')
-rw-r--r-- | src/asm2wasm.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/asm2wasm.h b/src/asm2wasm.h index b2e7f5512..9b503c84d 100644 --- a/src/asm2wasm.h +++ b/src/asm2wasm.h @@ -664,6 +664,10 @@ void Asm2WasmBuilder::processAsm(Ref ast) { }, debug, false /* do not validate globally yet */); } + // if we see no function tables in the processing below, then the table still exists and has size 0 + + wasm.table.initial = wasm.table.max = 0; + // first pass - do almost everything, but function imports and indirect calls for (unsigned i = 1; i < body->size(); i++) { @@ -784,7 +788,6 @@ void Asm2WasmBuilder::processAsm(Ref ast) { // TODO: when not using aliasing function pointers, we could merge them by noticing that // index 0 in each table is the null func, and each other index should only have one // non-null func. However, that breaks down when function pointer casts are emulated. - wasm.table.exists = true; if (wasm.table.segments.size() == 0) { wasm.table.segments.emplace_back(wasm.allocator.alloc<Const>()->set(Literal(uint32_t(0)))); } |