@@ -156,12 +156,20 @@ def metafunc(self, rawfs):
156156 return metafunc
157157
158158
159- def can_do_standalone (self ):
159+ def can_do_wasm2c (self ):
160+ # the npm version of wasm2c does not support MEMORY64
161+ return not self .get_setting ('MEMORY64' )
162+
163+
164+ def can_do_standalone (self , impure = False ):
165+ # Pure standalone engines don't support MEMORY64 yet. Even with MEMORY64=2 (lowered)
166+ # the WASI APIs that take pointer values don't have 64-bit variants yet.
167+ if self .get_setting ('MEMORY64' ) and not impure :
168+ return False
160169 return self .is_wasm () and \
161170 self .get_setting ('STACK_OVERFLOW_CHECK' , 0 ) < 2 and \
162171 not self .get_setting ('MINIMAL_RUNTIME' ) and \
163172 not self .get_setting ('SAFE_HEAP' ) and \
164- not self .get_setting ('MEMORY64' ) and \
165173 not any (a .startswith ('-fsanitize=' ) for a in self .emcc_args )
166174
167175
@@ -202,7 +210,7 @@ def metafunc(self, standalone):
202210 if not standalone :
203211 func (self )
204212 else :
205- if not can_do_standalone (self ):
213+ if not can_do_standalone (self , impure ):
206214 self .skipTest ('Test configuration is not compatible with STANDALONE_WASM' )
207215 self .set_setting ('STANDALONE_WASM' )
208216 # we will not legalize the JS ffi interface, so we must use BigInt
@@ -213,10 +221,9 @@ def metafunc(self, standalone):
213221 # if we are impure, disallow all wasm engines
214222 if impure :
215223 self .wasm_engines = []
216- self .js_engines = [config .NODE_JS ]
217224 self .node_args += shared .node_bigint_flags ()
218225 func (self )
219- if wasm2c :
226+ if wasm2c and can_do_wasm2c ( self ) :
220227 print ('wasm2c' )
221228 self .set_setting ('WASM2C' )
222229 self .wasm_engines = []
@@ -7160,6 +7167,8 @@ def test_wasm2c_sandboxing(self, mode):
71607167 self .node_args += shared .node_bigint_flags ()
71617168 if not can_do_standalone (self ):
71627169 return self .skipTest ('standalone mode not supported' )
7170+ if not can_do_wasm2c (self ):
7171+ return self .skipTest ('wasm2c not supported' )
71637172 self .set_setting ('STANDALONE_WASM' )
71647173 self .set_setting ('WASM2C' )
71657174 self .set_setting ('WASM2C_SANDBOXING' , mode )
0 commit comments