Skip to content

Commit

Permalink
Fix STACKTOP/STACK_MAX variables for relocatables (emscripten-core#8433)
Browse files Browse the repository at this point in the history
  • Loading branch information
rianhunter committed Apr 11, 2019
1 parent ec19d5f commit 34e2bed
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions emscripten.py
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,7 @@ def create_module_asmjs(function_table_sigs, metadata,
asm_runtime_thread_local_vars = create_asm_runtime_thread_local_vars()

stack = ''
if not (shared.Settings.WASM and shared.Settings.SIDE_MODULE):
if not shared.Settings.RELOCATABLE and not (shared.Settings.WASM and shared.Settings.SIDE_MODULE):
if 'STACKTOP' in shared.Settings.ASM_PRIMITIVE_VARS:
stack += apply_memory(' var STACKTOP = {{{ STACK_BASE }}};\n')
if 'STACK_MAX' in shared.Settings.ASM_PRIMITIVE_VARS:
Expand Down Expand Up @@ -1585,7 +1585,7 @@ def create_basic_vars(exported_implemented_functions, forwarded_json, metadata):

if shared.Settings.RELOCATABLE:
if not (shared.Settings.WASM and shared.Settings.SIDE_MODULE):
basic_vars += ['gb', 'fb']
basic_vars += ['gb', 'fb', 'STACKTOP', 'STACK_MAX']
else:
# wasm side modules have a specific convention for these
basic_vars += ['__memory_base', '__table_base']
Expand Down

0 comments on commit 34e2bed

Please sign in to comment.