symtab_findbyname: just retun NULL for NULL symtab

The condition is not fatal at all.
It's better to let the caller handle the failure.
This commit is contained in:
YAMAMOTO Takashi 2022-01-27 13:22:37 +09:00 committed by Petro Karashchenko
parent 4bd1bd177b
commit 0edb290951
1 changed files with 7 additions and 1 deletions

View File

@ -60,6 +60,12 @@ symtab_findbyname(FAR const struct symtab_s *symtab,
int cmp;
#endif
if (symtab == NULL)
{
DEBUGASSERT(nsyms == 0);
return NULL;
}
#ifdef CONFIG_SYMTAB_DECORATED
if (name[0] == '_')
{
@ -67,7 +73,7 @@ symtab_findbyname(FAR const struct symtab_s *symtab,
}
#endif
DEBUGASSERT(symtab != NULL && name != NULL);
DEBUGASSERT(name != NULL);
#ifdef CONFIG_SYMTAB_ORDEREDBYNAME
while (low < high)