You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by pk...@apache.org on 2022/01/27 09:23:44 UTC
[incubator-nuttx] branch master updated (4bd1bd1 -> dad4a7f)
This is an automated email from the ASF dual-hosted git repository.
pkarashchenko pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git.
from 4bd1bd1 RISC-V MMU: Add missing implementation for PTE getter
new 0edb290 symtab_findbyname: just retun NULL for NULL symtab
new dad4a7f symtab_findbyvalue: just retun NULL for NULL symtab
The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
libs/libc/symtab/symtab_findbyname.c | 8 +++++++-
libs/libc/symtab/symtab_findbyvalue.c | 6 +++++-
2 files changed, 12 insertions(+), 2 deletions(-)
[incubator-nuttx] 01/02: symtab_findbyname: just retun NULL for NULL symtab
Posted by pk...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
pkarashchenko pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git
commit 0edb29095124acf39f532909710fef4642378136
Author: YAMAMOTO Takashi <ya...@midokura.com>
AuthorDate: Thu Jan 27 13:22:37 2022 +0900
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.
---
libs/libc/symtab/symtab_findbyname.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/libs/libc/symtab/symtab_findbyname.c b/libs/libc/symtab/symtab_findbyname.c
index d3bd0d0..7efa80c 100644
--- a/libs/libc/symtab/symtab_findbyname.c
+++ b/libs/libc/symtab/symtab_findbyname.c
@@ -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)
[incubator-nuttx] 02/02: symtab_findbyvalue: just retun NULL for NULL symtab
Posted by pk...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
pkarashchenko pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git
commit dad4a7f8f7f9e5023faedefdfcdf0180010fea71
Author: YAMAMOTO Takashi <ya...@midokura.com>
AuthorDate: Thu Jan 27 13:23:17 2022 +0900
symtab_findbyvalue: just retun NULL for NULL symtab
---
libs/libc/symtab/symtab_findbyvalue.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/libs/libc/symtab/symtab_findbyvalue.c b/libs/libc/symtab/symtab_findbyvalue.c
index b1ecdae..86ac081 100644
--- a/libs/libc/symtab/symtab_findbyvalue.c
+++ b/libs/libc/symtab/symtab_findbyvalue.c
@@ -62,7 +62,11 @@ symtab_findbyvalue(FAR const struct symtab_s *symtab,
int low = 0;
#endif
- DEBUGASSERT(symtab != NULL);
+ if (symtab == NULL)
+ {
+ DEBUGASSERT(nsyms == 0);
+ return NULL;
+ }
#ifdef CONFIG_SYMTAB_ORDEREDBYVALUE