Skip to content

Commit

Permalink
cr suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
TianlongLiang committed Dec 1, 2023
1 parent 6d66413 commit adf359c
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions core/iwasm/fast-jit/jit_frontend.c
Original file line number Diff line number Diff line change
Expand Up @@ -226,17 +226,14 @@ is_shared_memory(WASMModule *module, uint32 mem_idx)
WASMMemoryImport *memory_import;
bool is_shared;

/* TODO: for now, only one memory in total is allowed, in the future should
* change this logic to support multiple memories */
if (module->memory_count != 0) {
memory = &module->memories[mem_idx];
is_shared = memory->flags & 0x02 ? true : false;
}
else if (module->import_memory_count != 0) {
if (mem_idx < module->import_memory_count) {
memory_import = &(module->import_memories[mem_idx].u.memory);
is_shared = memory_import->flags & 0x02 ? true : false;
}

else {
memory = &module->memories[mem_idx - module->import_memory_count];
is_shared = memory->flags & 0x02 ? true : false;
}
return is_shared;
}
#endif
Expand Down

0 comments on commit adf359c

Please sign in to comment.