diff options
author | Tom Tromey <tom@tromey.com> | 2022-09-24 13:34:09 -0600 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2022-10-16 10:50:47 -0600 |
commit | 98ed24fb35d89eb20179edf6c12f599c7a9e228e (patch) | |
tree | 222be496751ed4e4bdacc9beb242715e6ab8f696 /gdb/location.c | |
parent | 45685a2fd86073e76a772c5b677f14f8465a5040 (diff) | |
download | gdb-98ed24fb35d89eb20179edf6c12f599c7a9e228e.zip gdb-98ed24fb35d89eb20179edf6c12f599c7a9e228e.tar.gz gdb-98ed24fb35d89eb20179edf6c12f599c7a9e228e.tar.bz2 |
Use checked_static_cast in more places
I looked through all the uses of static_cast<... *> in gdb and
converted many of them to checked_static_cast.
I couldn't test a few of these changes.
Diffstat (limited to 'gdb/location.c')
-rw-r--r-- | gdb/location.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/gdb/location.c b/gdb/location.c index e4863fd..ba86b7c 100644 --- a/gdb/location.c +++ b/gdb/location.c @@ -221,7 +221,7 @@ const linespec_location_spec * as_linespec_location_spec (const location_spec *locspec) { gdb_assert (locspec->type () == LINESPEC_LOCATION_SPEC); - return static_cast<const linespec_location_spec *> (locspec); + return gdb::checked_static_cast<const linespec_location_spec *> (locspec); } /* See description in location.h. */ @@ -240,7 +240,7 @@ const address_location_spec * as_address_location_spec (const location_spec *locspec) { gdb_assert (locspec->type () == ADDRESS_LOCATION_SPEC); - return static_cast<const address_location_spec *> (locspec); + return gdb::checked_static_cast<const address_location_spec *> (locspec); } /* See description in location.h. */ @@ -257,7 +257,7 @@ const probe_location_spec * as_probe_location_spec (const location_spec *locspec) { gdb_assert (locspec->type () == PROBE_LOCATION_SPEC); - return static_cast<const probe_location_spec *> (locspec); + return gdb::checked_static_cast<const probe_location_spec *> (locspec); } /* See description in location.h. */ @@ -266,7 +266,7 @@ const explicit_location_spec * as_explicit_location_spec (const location_spec *locspec) { gdb_assert (locspec->type () == EXPLICIT_LOCATION_SPEC); - return static_cast<const explicit_location_spec *> (locspec); + return gdb::checked_static_cast<const explicit_location_spec *> (locspec); } /* See description in location.h. */ @@ -275,7 +275,7 @@ explicit_location_spec * as_explicit_location_spec (location_spec *locspec) { gdb_assert (locspec->type () == EXPLICIT_LOCATION_SPEC); - return static_cast<explicit_location_spec *> (locspec); + return gdb::checked_static_cast<explicit_location_spec *> (locspec); } /* Return a string representation of the explicit location spec in |