Don't allow NULL as an argument to block_scope

block_scope 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:37:15 -07:00
parent f52688890e
commit 683aecac8c
3 changed files with 6 additions and 5 deletions

View File

@ -373,7 +373,9 @@ rust_parser::crate_name (const std::string &name)
std::string
rust_parser::super_name (const std::string &ident, unsigned int n_supers)
{
const char *scope = block_scope (pstate->expression_context_block);
const char *scope = "";
if (pstate->expression_context_block != nullptr)
scope = block_scope (pstate->expression_context_block);
int offset;
if (scope[0] == '\0')