Don't allow NULL as an argument to block_global_block

block_global_block has special behavior when the block is NULL.
Remove this and patch up the callers instead.
This commit is contained in:
Tom Tromey
2023-01-19 17:22:04 -07:00
parent 7800409613
commit 8f14fd1120
3 changed files with 12 additions and 14 deletions

View File

@@ -378,15 +378,11 @@ block_static_block (const struct block *block)
return block;
}
/* Return the static block associated to BLOCK. Return NULL if block
is NULL. */
/* Return the static block associated to BLOCK. */
const struct block *
block_global_block (const struct block *block)
{
if (block == NULL)
return NULL;
while (block->superblock () != NULL)
block = block->superblock ();