[5/5] gdb: remove unnecessary nullptr check in remove_user_added_objfile

Message ID 20240206171514.119244-6-simon.marchi@efficios.com
State New
Headers
Series Random cleanup patches |

Checks

Context Check Description
linaro-tcwg-bot/tcwg_gdb_build--master-aarch64 success Testing passed
linaro-tcwg-bot/tcwg_gdb_build--master-arm success Testing passed
linaro-tcwg-bot/tcwg_gdb_check--master-arm fail Testing failed
linaro-tcwg-bot/tcwg_gdb_check--master-aarch64 fail Testing failed

Commit Message

Simon Marchi Feb. 6, 2024, 5:14 p.m. UTC
  Since commit 74daa597e74 ("gdb: add all_objfiles_removed observer"), the
objfile passed to the free_objfile observable can't be nullptr.

Change-Id: If215aa051ab43c068b11746938022c7efca09caa
---
 gdb/solib.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Patch

diff --git a/gdb/solib.c b/gdb/solib.c
index bd69c549b8e8..3eb84d814a20 100644
--- a/gdb/solib.c
+++ b/gdb/solib.c
@@ -1698,7 +1698,7 @@  gdb_bfd_lookup_symbol (bfd *abfd,
 static void
 remove_user_added_objfile (struct objfile *objfile)
 {
-  if (objfile != 0 && objfile->flags & OBJF_USERLOADED)
+  if (objfile->flags & OBJF_USERLOADED)
     {
       for (solib &so : objfile->pspace->solibs ())
 	if (so.objfile == objfile)