Skip to content

Commit 58e713e

Browse files
committed
.
1 parent bc22316 commit 58e713e

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

emscripten.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1598,6 +1598,14 @@ def create_basic_funcs(function_table_sigs, invoke_function_names):
15981598
basic_funcs = shared.Settings.RUNTIME_FUNCS_TO_IMPORT
15991599
if shared.Settings.STACK_OVERFLOW_CHECK and not shared.Settings.MINIMAL_RUNTIME:
16001600
basic_funcs += ['abortStackOverflow']
1601+
if shared.Settings.SAFE_HEAP:
1602+
if asm_safe_heap():
1603+
basic_funcs += ['segfault', 'alignfault', 'ftfault']
1604+
else:
1605+
# Binaryen generates calls to these two so they are always needed with wasm
1606+
if shared.Settings.WASM:
1607+
basic_funcs += ['segfault', 'alignfault']
1608+
basic_funcs += ['SAFE_HEAP_LOAD', 'SAFE_HEAP_LOAD_D', 'SAFE_HEAP_STORE', 'SAFE_HEAP_STORE_D', 'SAFE_FT_MASK']
16011609

16021610
if shared.Settings.ASSERTIONS:
16031611
for sig in function_table_sigs:

tests/test_other.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8301,7 +8301,7 @@ def test_single_file(self):
83018301
meminit1_enabled,
83028302
debug_enabled,
83038303
closure_enabled,
8304-
wasm_enabled) in itertools.product([True, False], repeat=7):
8304+
wasm_enabled) in itertools.product([True, False], repeat=5):
83058305
# skip unhelpful option combinations
83068306
if wasm_enabled and meminit1_enabled:
83078307
continue
@@ -8310,9 +8310,7 @@ def test_single_file(self):
83108310

83118311
expect_wasm = wasm_enabled
83128312
expect_meminit = meminit1_enabled and not wasm_enabled
8313-
expect_success = not single_file_enabled
83148313
expect_wat = debug_enabled and wasm_enabled and not self.is_wasm_backend()
8315-
should_run_js = expect_success
83168314

83178315
cmd = [PYTHON, EMCC, path_from_root('tests', 'hello_world.c')]
83188316

@@ -8330,9 +8328,6 @@ def test_single_file(self):
83308328
cmd += ['-s', 'WASM=0']
83318329

83328330
self.clear()
8333-
if not expect_success:
8334-
self.expect_fail(cmd)
8335-
continue
83368331

83378332
def do_test(cmd):
83388333
print(' '.join(cmd))
@@ -8341,8 +8336,7 @@ def do_test(cmd):
83418336
assert expect_meminit == (os.path.exists('a.out.mem') or os.path.exists('a.out.js.mem'))
83428337
assert expect_wasm == os.path.exists('a.out.wasm')
83438338
assert expect_wat == os.path.exists('a.out.wat')
8344-
if should_run_js:
8345-
self.assertContained('hello, world!', run_js('a.out.js'))
8339+
self.assertContained('hello, world!', run_js('a.out.js'))
83468340

83478341
do_test(cmd)
83488342

0 commit comments

Comments
 (0)