From 23cb9559ff4549e133242018abc37680d4e2badd Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Thu, 29 Aug 2013 15:30:39 -0700 Subject: use a separate stack in each asm module; fixes asm2g.test_dlfcn_stack_forward --- src/shell_sharedlib.js | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src') diff --git a/src/shell_sharedlib.js b/src/shell_sharedlib.js index a2956c24..e57918ea 100644 --- a/src/shell_sharedlib.js +++ b/src/shell_sharedlib.js @@ -6,6 +6,13 @@ Module.print = parentModule.print; Module.printErr = parentModule.printErr; +#if ASM_JS + // Each module has its own stack + var STACKTOP = parentModule['_malloc'](TOTAL_STACK); + assert(STACKTOP % 8 == 0); + var STACK_MAX = STACKTOP + TOTAL_STACK; +#endif + {{BODY}} // {{MODULE_ADDITIONS}} -- cgit v1.2.3-70-g09d2