From 683aecac8c37c11d63203c96455a3d9ecf50bbe9 Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Thu, 19 Jan 2023 17:37:15 -0700 Subject: 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. --- gdb/rust-parse.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'gdb/rust-parse.c') diff --git a/gdb/rust-parse.c b/gdb/rust-parse.c index 489be4b..72b843e 100644 --- a/gdb/rust-parse.c +++ b/gdb/rust-parse.c @@ -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') -- cgit v1.1