]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Use array_view for symbol_impls
authorTom Tromey <tom@tromey.com>
Sat, 16 Apr 2022 18:36:47 +0000 (12:36 -0600)
committerTom Tromey <tom@tromey.com>
Wed, 20 Apr 2022 15:28:16 +0000 (09:28 -0600)
It seemed to me that using array_view for symbol_impls would give a
bit more error checking, at least when gdb is built in libstdc++ debug
mode.

gdb/symtab.c
gdb/symtab.h

index a75492603b8e73764666c466a8466ba481d4778d..43a64edab3416af27b37ac8f9281ab4d55323f2f 100644 (file)
@@ -6502,7 +6502,7 @@ static struct symbol_impl symbol_impl[MAX_SYMBOL_IMPLS];
 /* The globally visible pointer.  This is separate from 'symbol_impl'
    so that it can be const.  */
 
-const struct symbol_impl *symbol_impls = &symbol_impl[0];
+gdb::array_view<const struct symbol_impl> symbol_impls (symbol_impl);
 
 /* Make sure we saved enough room in struct symbol.  */
 
index 41c8654a5eff9a96c82f37016555b2061b869e39..0adedd9841a4cac35bfacb0ba6637446c7f262d5 100644 (file)
@@ -1188,7 +1188,7 @@ enum symbol_subclass_kind
   SYMBOL_RUST_VTABLE
 };
 
-extern const struct symbol_impl *symbol_impls;
+extern gdb::array_view<const struct symbol_impl> symbol_impls;
 
 /* This structure is space critical.  See space comments at the top.  */