Skip to content

Commit

Permalink
NuttX: Fix a dbus-related crash on esp32s3 (#3470)
Browse files Browse the repository at this point in the history
Although I don't know what exactly the esp32s3 rom version of memset is,
it seems that the current code crashes only with a small "len". I guess
it changes the logic depending on the size.
Anyway, it's safer to use dbus here.
  • Loading branch information
yamt authored May 27, 2024
1 parent a9eff69 commit 6067dbb
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions core/shared/platform/nuttx/nuttx_platform.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,13 @@ os_mmap(void *hint, size_t size, int prot, int flags, os_file_handle file)
if ((prot & MMAP_PROT_EXEC) != 0) {
p = up_textheap_memalign(sizeof(void *), size);
if (p) {
#if (WASM_MEM_DUAL_BUS_MIRROR != 0)
void *dp = os_get_dbus_mirror(p);
memset(dp, 0, size);
os_dcache_flush();
#else
memset(p, 0, size);
#endif
}
return p;
}
Expand Down

0 comments on commit 6067dbb

Please sign in to comment.