From b258f03455399fcadc6a4ba7426fa447fe6dff66 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Sat, 26 Dec 2015 16:20:40 -0500 Subject: implement a temporary hack for __stack_pointer --- src/s2wasm.h | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/s2wasm.h b/src/s2wasm.h index dd4437ed9..af5fccf82 100644 --- a/src/s2wasm.h +++ b/src/s2wasm.h @@ -42,11 +42,12 @@ class S2WasmBuilder { public: S2WasmBuilder(AllocatingModule& wasm, const char* input, bool debug, size_t globalBase) : wasm(wasm), allocator(wasm.allocator), debug(debug), globalBase(globalBase), nextStatic(globalBase) { - s = input; - scan(); - s = input; - process(); - fix(); + s = input; + scan(); + s = input; + prepare(); + process(); + fix(); } private: @@ -302,6 +303,10 @@ private: } } + void prepare() { + staticAddresses["__stack_pointer"] = 0; // XXX HACK for now + } + void process() { while (*s) { skipWhitespace(); -- cgit v1.2.3