mirror of
https://github.com/bytecodealliance/wasm-micro-runtime.git
synced 2025-02-11 17:35:13 +00:00
Relax wasi memory export check when wasi-threads is enabled (#1893)
https://github.com/WebAssembly/wasi-threads/issues/22 https://github.com/WebAssembly/WASI/issues/502
This commit is contained in:
parent
903f5212f1
commit
5f0f8fe7ee
|
@ -4185,7 +4185,20 @@ check_wasi_abi_compatibility(const WASMModule *module,
|
||||||
|
|
||||||
memory = wasm_loader_find_export(module, "", "memory", EXPORT_KIND_MEMORY,
|
memory = wasm_loader_find_export(module, "", "memory", EXPORT_KIND_MEMORY,
|
||||||
error_buf, error_buf_size);
|
error_buf, error_buf_size);
|
||||||
if (!memory) {
|
if (!memory
|
||||||
|
#if WASM_ENABLE_LIB_WASI_THREADS != 0
|
||||||
|
/*
|
||||||
|
* with wasi-threads, it's still an open question if a memory
|
||||||
|
* should be exported.
|
||||||
|
*
|
||||||
|
* https://github.com/WebAssembly/wasi-threads/issues/22
|
||||||
|
* https://github.com/WebAssembly/WASI/issues/502
|
||||||
|
*
|
||||||
|
* Note: this code assumes the number of memories is at most 1.
|
||||||
|
*/
|
||||||
|
&& module->import_memory_count == 0
|
||||||
|
#endif
|
||||||
|
) {
|
||||||
set_error_buf(error_buf, error_buf_size,
|
set_error_buf(error_buf, error_buf_size,
|
||||||
"a module with WASI apis must export memory by default");
|
"a module with WASI apis must export memory by default");
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user