AOT: fix crash in dumping call stack when the AOT file doesn't contain custom name section (#1508)

This commit is contained in:
Shengyun Zhou 2022-09-20 20:47:17 +08:00 committed by GitHub
parent aba3707529
commit ba3af0b196
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2920,6 +2920,9 @@ lookup_func_name(const char **func_names, uint32 *func_indexes,
int64 low = 0, mid; int64 low = 0, mid;
int64 high = func_index_count - 1; int64 high = func_index_count - 1;
if (!func_names || !func_indexes || func_index_count == 0)
return NULL;
while (low <= high) { while (low <= high) {
mid = (low + high) / 2; mid = (low + high) / 2;
if (func_index == func_indexes[mid]) { if (func_index == func_indexes[mid]) {