Skip to content

Commit 6067dbb

Browse files
authored
NuttX: Fix a dbus-related crash on esp32s3 (#3470)
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.
1 parent a9eff69 commit 6067dbb

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

core/shared/platform/nuttx/nuttx_platform.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,13 @@ os_mmap(void *hint, size_t size, int prot, int flags, os_file_handle file)
5353
if ((prot & MMAP_PROT_EXEC) != 0) {
5454
p = up_textheap_memalign(sizeof(void *), size);
5555
if (p) {
56+
#if (WASM_MEM_DUAL_BUS_MIRROR != 0)
57+
void *dp = os_get_dbus_mirror(p);
58+
memset(dp, 0, size);
59+
os_dcache_flush();
60+
#else
5661
memset(p, 0, size);
62+
#endif
5763
}
5864
return p;
5965
}

0 commit comments

Comments
 (0)