Skip to content

Commit 93b2135

Browse files
authored
Add missing #if ASSERTIONS guard in runtime_init_memory.js (emscripten-core#20671)
1 parent b7d8498 commit 93b2135

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/runtime_init_memory.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,10 @@
1111

1212
{{{ makeModuleReceiveWithVar('INITIAL_MEMORY', undefined, INITIAL_MEMORY) }}}
1313

14+
#if ASSERTIONS
1415
assert(INITIAL_MEMORY >= {{{STACK_SIZE}}}, 'INITIAL_MEMORY should be larger than STACK_SIZE, was ' + INITIAL_MEMORY + '! (STACK_SIZE=' + {{{STACK_SIZE}}} + ')');
15-
16+
#endif
17+
1618
// check for full engine support (use string 'subarray' to avoid closure compiler confusion)
1719

1820
#if PTHREADS

test/test_core.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2449,6 +2449,8 @@ def test_module_wasm_memory(self):
24492449
else:
24502450
self.emcc_args += ['--pre-js', test_file('core/test_module_wasm_memory.js')]
24512451
self.set_setting('IMPORTED_MEMORY')
2452+
self.set_setting('STRICT')
2453+
self.set_setting('INCOMING_MODULE_JS_API', ['wasmMemory'])
24522454
self.do_runf('core/test_module_wasm_memory.c', 'success')
24532455

24542456
def test_ssr(self): # struct self-ref

0 commit comments

Comments
 (0)