diff --git a/src/preamble.js b/src/preamble.js index fb8954566aa82..eb885e27c21a8 100644 --- a/src/preamble.js +++ b/src/preamble.js @@ -503,10 +503,9 @@ var splitModuleProxyHandler = { // When the table is dynamically laid out, the placeholder functions names // are offsets from the table base. In the main module, the table base is // always 1. - return wasmTable.get(1 + parseInt(prop))(...args); -#else - return wasmTable.get(prop)(...args); + prop = 1 + parseInt(prop); #endif + return wasmTable.get({{{ toIndexType('prop') }}})(...args); #endif } } diff --git a/test/test_other.py b/test/test_other.py index 8dc8b886cbe1f..a4105d8185cad 100644 --- a/test/test_other.py +++ b/test/test_other.py @@ -12816,6 +12816,7 @@ def test_syslog(self): def test_syscall_stubs(self): self.do_other_test('test_syscall_stubs.c') + @also_with_wasm64 @parameterized({ '': (False, False, False), 'custom': (True, False, False), @@ -12848,6 +12849,8 @@ def test_split_module(self, customLoader, jspi, opt): '--export-prefix=%', 'test_split_module.wasm.orig', '-o1', 'primary.wasm', '-o2', 'secondary.wasm', '--profile=profile.data'] if jspi: wasm_split_run += ['--jspi', '--enable-reference-types'] + if self.get_setting('MEMORY64'): + wasm_split_run += ['--enable-memory64'] self.run_process(wasm_split_run) os.remove('test_split_module.wasm')