Skip to content

Commit

Permalink
module_load: allow multiple memories
Browse files Browse the repository at this point in the history
  • Loading branch information
yamt committed Jan 29, 2023
1 parent a8c053c commit eef6ba5
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/module.c
Original file line number Diff line number Diff line change
Expand Up @@ -1694,10 +1694,12 @@ module_load(struct module *m, const uint8_t *p, const uint8_t *ep,
* https://webassembly.github.io/spec/core/valid/modules.html
*/

#if !defined(TOYWASM_ENABLE_WASM_MULTI_MEMORY)
if (m->nimportedmems + m->nmems > 1) {
ret = EINVAL;
goto fail;
}
#endif

if ((m->funcs == NULL) != (m->nfuncs == 0)) {
/* maybe there was no code section */
Expand Down

0 comments on commit eef6ba5

Please sign in to comment.