public inbox for gdb-cvs@sourceware.org
help / color / mirror / Atom feed
* [binutils-gdb] Don't allow NULL as an argument to block_using
@ 2023-02-19 23:37 Tom Tromey
  0 siblings, 0 replies; only message in thread
From: Tom Tromey @ 2023-02-19 23:37 UTC (permalink / raw)
  To: gdb-cvs

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;

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-02-19 23:37 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-19 23:37 [binutils-gdb] Don't allow NULL as an argument to block_using Tom Tromey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).