summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2016-11-14 16:03:00 -0800
committerAlon Zakai <alonzakai@gmail.com>2016-12-07 16:50:04 -1000
commit49bdfd20094e909fb6f4ea989e2a2cbfe01e8741 (patch)
tree2aebda3b4b6d3655561a7281e3bf9396d8709c1b /src
parent5242ab0fe2ec18f249aafc34fd73a0b36d1e48ac (diff)
downloadbinaryen-49bdfd20094e909fb6f4ea989e2a2cbfe01e8741.tar.gz
binaryen-49bdfd20094e909fb6f4ea989e2a2cbfe01e8741.tar.bz2
binaryen-49bdfd20094e909fb6f4ea989e2a2cbfe01e8741.zip
use tableBase for the table segments
Diffstat (limited to 'src')
-rw-r--r--src/asm2wasm.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/asm2wasm.h b/src/asm2wasm.h
index 2a6bcd0e7..951a0e019 100644
--- a/src/asm2wasm.h
+++ b/src/asm2wasm.h
@@ -801,7 +801,7 @@ void Asm2WasmBuilder::processAsm(Ref ast) {
// 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.
if (wasm.table.segments.size() == 0) {
- wasm.table.segments.emplace_back(wasm.allocator.alloc<Const>()->set(Literal(uint32_t(0))));
+ wasm.table.segments.emplace_back(builder.makeGetGlobal(Name("tableBase"), i32));
}
auto& segment = wasm.table.segments[0];
functionTableStarts[name] = segment.data.size(); // this table starts here