Quellcode durchsuchen

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.
YAMAMOTO Takashi vor 1 Jahr
Ursprung
Commit
6067dbb3ab
1 geänderte Dateien mit 6 neuen und 0 gelöschten Zeilen
  1. 6 0
      core/shared/platform/nuttx/nuttx_platform.c

+ 6 - 0
core/shared/platform/nuttx/nuttx_platform.c

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