From 62c07b549d14dfb974f73554026f0b9fff365968 Mon Sep 17 00:00:00 2001 From: Derek Schuff Date: Wed, 6 Apr 2016 11:58:55 -0700 Subject: Properly align the stack pointer * Properly align the stack pointer By default (if no global base is given) the global base is 1, which seems wrong. In this case the stack pointer gets an address of 1, which is unaligned and definitely wrong. So, start the global base at 0 instead of 1 by default and align the stack pointer. Also factor allocation of statics into a function. * unconditionally allocate stack pointer; explicitly reserve address 0 --- auto_update_tests.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'auto_update_tests.py') diff --git a/auto_update_tests.py b/auto_update_tests.py index f4f8d0c1d..f0cba64ef 100755 --- a/auto_update_tests.py +++ b/auto_update_tests.py @@ -30,7 +30,8 @@ for dot_s_dir in ['dot_s', 'llvm_autogenerated']: print '..', s wasm = s.replace('.s', '.wast') full = os.path.join('test', dot_s_dir, s) - cmd = [os.path.join('bin', 's2wasm'), full] + stack_alloc = ['--allocate-stack=1024'] if dot_s_dir == 'llvm_autogenerated' else [] + cmd = [os.path.join('bin', 's2wasm'), full] + stack_alloc if s.startswith('start_'): cmd.append('--start') actual, err = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate() -- cgit v1.2.3