Make ASSERTIONS=2 imply STACK_OVERFLOW_CHECK=2 (#12579)

This is in addition to the existing 1 implying 1.

The goal is to make it easier to use -s ASSERTIONS=2 and have it check
as many things as possible.
This commit is contained in:
Alon Zakai 2020-10-23 11:34:53 -07:00 коммит произвёл GitHub
Родитель a51335751c
Коммит dab23338a2
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
3 изменённых файлов: 12 добавлений и 3 удалений

Просмотреть файл

@ -20,6 +20,8 @@ See docs/process.md for more on how version tagging works.
Current Trunk
-------------
- `-s ASSERTIONS=2` now implies `-s STACK_OVERFLOW_CHECK=2`. Previously only
`-s ASSERTIONS=1` implied `-s STACK_OVERFLOW_CHECK=1`.
- Dynamic linking (MAIN_MODULE + SIDE_MODULE) now produces wasm binaries that
depend on mutable globals. Specifically the stack pointer global is mutable
and shared between the modules. This is an ABI change for dynamic linking.

Просмотреть файл

@ -1236,9 +1236,11 @@ There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR P
# Note the exports the user requested
building.user_requested_exports = shared.Settings.EXPORTED_FUNCTIONS[:]
# -s ASSERTIONS=1 implies basic stack overflow checks.
if shared.Settings.ASSERTIONS:
shared.Settings.STACK_OVERFLOW_CHECK = max(1, shared.Settings.STACK_OVERFLOW_CHECK)
# -s ASSERTIONS=1 implies basic stack overflow checks, and ASSERTIONS=2
# implies full stack overflow checks (unless the user specifically set
# something else)
if shared.Settings.ASSERTIONS and 'STACK_OVERFLOW_CHECK' not in settings_key_changes:
shared.Settings.STACK_OVERFLOW_CHECK = max(shared.Settings.ASSERTIONS, shared.Settings.STACK_OVERFLOW_CHECK)
if shared.Settings.LLD_REPORT_UNDEFINED or shared.Settings.STANDALONE_WASM:
# Reporting undefined symbols at wasm-ld time requires us to know if we have a `main` function

5
tests/test_core.py поставляемый
Просмотреть файл

@ -7692,6 +7692,11 @@ NODEFS is no longer included by default; build with -lnodefs.js
self.emcc_args += ['-DONE_BIG_STRING']
self.do_runf(path_from_root('tests', 'stack_overflow.cpp'), 'stack overflow', assert_returncode=NON_ZERO)
# ASSERTIONS=2 implies STACK_OVERFLOW_CHECK=2
self.clear_setting('STACK_OVERFLOW_CHECK')
self.set_setting('ASSERTIONS', 2)
self.do_runf(path_from_root('tests', 'stack_overflow.cpp'), 'stack overflow', assert_returncode=NON_ZERO)
@node_pthreads
def test_binaryen_2170_emscripten_atomic_cas_u8(self):
self.emcc_args += ['-s', 'USE_PTHREADS=1']