[04/27] Don't allow NULL as an argument to block_using

Message ID 20230120214618.3236224-5-tom@tromey.com
State New
Headers
Series C++-ify struct block |

Commit Message

Tom Tromey Jan. 20, 2023, 9:45 p.m. UTC
  block_using has special behavior when the block is NULL.
Remove this.  No caller seems to be affected.
---
 gdb/block.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Patch

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;