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/
This commit is contained in:
Ayke van Laethem
2019-07-07 19:49:11 +02:00
committed by Ron Evans
parent d627208c48
commit 00cc486619
+1
View File
@@ -14,6 +14,7 @@
"ldflags": [
"--allow-undefined",
"--no-threads",
"--stack-first",
"--export-all"
],
"emulator": ["node", "targets/wasm_exec.js"]