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.
This commit is contained in:
YAMAMOTO Takashi 2024-05-27 12:07:30 +09:00 committed by GitHub
parent a9eff69dd9
commit 6067dbb3ab
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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;
}