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

@ -239,7 +239,9 @@ convert_symbol_sym (compile_cplus_instance *instance,
}
*/
const struct block *static_block = block_static_block (sym.block);
const struct block *static_block = nullptr;
if (sym.block != nullptr)
static_block = block_static_block (sym.block);
/* STATIC_BLOCK is NULL if FOUND_BLOCK is the global block. */
bool is_local_symbol = (sym.block != static_block && static_block != nullptr);
if (is_local_symbol)