diff options
author | Ayke van Laethem <[email protected]> | 2019-07-07 19:49:11 +0200 |
---|---|---|
committer | Ron Evans <[email protected]> | 2019-07-08 00:09:59 +0200 |
commit | 00cc486619814a817c03145da481765fe909e818 (patch) | |
tree | 32f25581f197e728c86d73f7315c057e72c40945 | |
parent | d627208c48501e649a0c2a477f77556af1e35a99 (diff) | |
download | tinygo-00cc486619814a817c03145da481765fe909e818.tar.gz tinygo-00cc486619814a817c03145da481765fe909e818.zip |
wasm: set the stack at the start of linear memory
This makes sure that a stack overflow will cause a "memory access out of
bounds" error instead of a corruption of a global variable.
Here is more background on a very similar stack overflow protection:
https://blog.japaric.io/stack-overflow-protection/
-rw-r--r-- | targets/wasm.json | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/targets/wasm.json b/targets/wasm.json index 82fb6cedf..e8cdb5e15 100644 --- a/targets/wasm.json +++ b/targets/wasm.json @@ -14,6 +14,7 @@ "ldflags": [ "--allow-undefined", "--no-threads", + "--stack-first", "--export-all" ], "emulator": ["node", "targets/wasm_exec.js"] |