Don't allow NULL as an argument to block_using
authorTom Tromey <tom@tromey.com>
Fri, 20 Jan 2023 00:13:22 +0000 (17:13 -0700)
committerTom Tromey <tom@tromey.com>
Sun, 19 Feb 2023 19:51:05 +0000 (12:51 -0700)
block_using has special behavior when the block is NULL.
Remove this.  No caller seems to be affected.

gdb/block.c

index f24a2b5d0848f154266c8279f67fec5c81c65119..97a0214e0370b3a9b64174b690148338cd67867d 100644 (file)
@@ -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;