diff options
author | Tom Tromey <tromey@adacore.com> | 2022-08-17 11:47:17 -0600 |
---|---|---|
committer | Tom Tromey <tromey@adacore.com> | 2022-09-12 14:25:06 -0600 |
commit | 5f48d886a9ce0b7d109a26c860adf66330ca65cf (patch) | |
tree | 27ac0194e55feb3eb8a4a1ea9541fa4cec0c6652 /gdb/location.c | |
parent | 29a6701e530a4119d3c0d261da2b7b24034c9233 (diff) | |
download | gdb-5f48d886a9ce0b7d109a26c860adf66330ca65cf.zip gdb-5f48d886a9ce0b7d109a26c860adf66330ca65cf.tar.gz gdb-5f48d886a9ce0b7d109a26c860adf66330ca65cf.tar.bz2 |
Use checked_static_cast in more places
I went through all the uses of dynamic_cast<> in gdb, looking for ones
that could be replaced with checked_static_cast. This patch is the
result. Regression tested on x86-64 Fedora 34.
Diffstat (limited to 'gdb/location.c')
-rw-r--r-- | gdb/location.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/gdb/location.c b/gdb/location.c index 2b31baa..e4863fd 100644 --- a/gdb/location.c +++ b/gdb/location.c @@ -18,6 +18,7 @@ #include "defs.h" #include "gdbsupport/gdb_assert.h" +#include "gdbsupport/gdb-checked-static-cast.h" #include "location.h" #include "symtab.h" #include "language.h" @@ -848,8 +849,7 @@ string_to_location_spec (const char **stringp, linespec parsing below and discard the explicit location spec. */ explicit_location_spec *xloc - = dynamic_cast<explicit_location_spec *> (locspec.get ()); - gdb_assert (xloc != nullptr); + = gdb::checked_static_cast<explicit_location_spec *> (locspec.get ()); match_type = xloc->func_name_match_type; } |