summaryrefslogtreecommitdiff
path: root/src/asm2wasm.h
diff options
context:
space:
mode:
authorDerek Schuff <dschuff@chromium.org>2016-10-03 21:41:43 -0700
committerGitHub <noreply@github.com>2016-10-03 21:41:43 -0700
commitc4e70a04c42cdad380707d2e4b4f6f9503462414 (patch)
tree5c221b431b75e1729689a47857153756bc9e5c08 /src/asm2wasm.h
parent5046a524d506add48cb3779b39b4983e78292410 (diff)
downloadbinaryen-c4e70a04c42cdad380707d2e4b4f6f9503462414.tar.gz
binaryen-c4e70a04c42cdad380707d2e4b4f6f9503462414.tar.bz2
binaryen-c4e70a04c42cdad380707d2e4b4f6f9503462414.zip
More binary updates for 0xc (#733)
Refine tables to explicitly exist or not. Previously they were printed or encoded if it had any segments, or an initial or max size. However tables can be defined but empty, so we had a special hack that defined an empty segment when we really just wanted an empty table. Now, just make the existence explicit. Update Function table encoding for 0xc (Table and Element sections) Add end opcodes after function bodies (these are consumed by getMaybeBlock with the same behavior that it had before when it reached the function end, so no explicit decode) Update call_indirect encoding for 0xc (no arity, call target is last)
Diffstat (limited to 'src/asm2wasm.h')
-rw-r--r--src/asm2wasm.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/asm2wasm.h b/src/asm2wasm.h
index afd85feb6..f00004b1f 100644
--- a/src/asm2wasm.h
+++ b/src/asm2wasm.h
@@ -777,6 +777,7 @@ 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))));
}