[binutils-gdb] Don't allow NULL as an argument to block_using

Tom Tromey tromey@sourceware.org
Sun Feb 19 23:37:14 GMT 2023


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=392c1cbd745a575c5894ea33876f255b66a14d89

commit 392c1cbd745a575c5894ea33876f255b66a14d89
Author: Tom Tromey <tom@tromey.com>
Date:   Thu Jan 19 17:13:22 2023 -0700

    Don't allow NULL as an argument to block_using
    
    block_using has special behavior when the block is NULL.
    Remove this.  No caller seems to be affected.

Diff:
---
 gdb/block.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gdb/block.c b/gdb/block.c
index f24a2b5d084..97a0214e037 100644
--- a/gdb/block.c
+++ b/gdb/block.c
@@ -337,7 +337,7 @@ block_set_scope (struct block *block, const char *scope,
 struct using_direct *
 block_using (const struct block *block)
 {
-  if (block == NULL || block->namespace_info () == NULL)
+  if (block->namespace_info () == NULL)
     return NULL;
   else
     return block->namespace_info ()->using_decl;


More information about the Gdb-cvs mailing list