Check arguments before calling bh_hash_map_find (#3055)

Check whether the arguments are NULL before calling bh_hash_map_find,
or lots of "HashMap find elem failed: map or key is NULL" warnings may
be dumped. Reported in #3053.
This commit is contained in:
Wenyong Huang
2024-01-19 19:29:21 +08:00
committed by GitHub
parent 17b0111577
commit ec6d9cb6be
2 changed files with 15 additions and 4 deletions

View File

@ -176,8 +176,9 @@ acquire_wait_info(void *address, AtomicWaitNode *wait_node)
AtomicWaitInfo *wait_info = NULL;
bh_list_status ret;
if (address)
wait_info = (AtomicWaitInfo *)bh_hash_map_find(wait_map, address);
bh_assert(address != NULL);
wait_info = (AtomicWaitInfo *)bh_hash_map_find(wait_map, address);
if (!wait_node) {
return wait_info;