Don't allow NULL as an argument to block_static_block

block_static_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:20:09 -07:00
parent 392c1cbd74
commit 7800409613
6 changed files with 30 additions and 11 deletions

View File

@@ -13795,7 +13795,11 @@ public:
{
struct block_symbol sym;
sym = ada_lookup_symbol (name, block_static_block (block), domain);
sym = ada_lookup_symbol (name,
(block == nullptr
? nullptr
: block_static_block (block)),
domain);
if (sym.symbol != NULL)
return sym;