From 49bdfd20094e909fb6f4ea989e2a2cbfe01e8741 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Mon, 14 Nov 2016 16:03:00 -0800 Subject: use tableBase for the table segments --- src/asm2wasm.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') 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()->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 -- cgit v1.2.3