Explorar o código

log warning instaed of assertion (#4119)

TianlongLiang hai 1 ano
pai
achega
e693608476
Modificáronse 1 ficheiros con 5 adicións e 2 borrados
  1. 5 2
      core/iwasm/aot/aot_loader.c

+ 5 - 2
core/iwasm/aot/aot_loader.c

@@ -317,9 +317,12 @@ loader_mmap(uint32 size, bool prot_exec, char *error_buf, uint32 error_buf_size)
     map_flags = MMAP_MAP_32BIT;
     if ((mem = os_mmap(NULL, size, map_prot, map_flags,
                        os_get_invalid_handle()))) {
-        /* The mmapped memory must be in the first 2 Gigabytes of the
+        /* Test whether the mmapped memory in the first 2 Gigabytes of the
            process address space */
-        bh_assert((uintptr_t)mem < INT32_MAX);
+        if ((uintptr_t)mem >= INT32_MAX)
+            LOG_WARNING(
+                "Warning: loader mmap memory address is not in the first 2 "
+                "Gigabytes of the process address space.");
         return mem;
     }
 #endif