diff options
Diffstat (limited to 'src/s2wasm.h')
-rw-r--r-- | src/s2wasm.h | 15 |
1 files changed, 10 insertions, 5 deletions
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(); |