diff options
author | Simon Marchi <simon.marchi@efficios.com> | 2023-10-10 14:03:18 -0400 |
---|---|---|
committer | Simon Marchi <simon.marchi@efficios.com> | 2023-10-19 10:57:51 -0400 |
commit | 3fcbae9d9c7cdc4103c4f494f5d3c63b373617ee (patch) | |
tree | 1b9c686e8c012c529b370245beb56262fde7f8bc /gdb/solib-darwin.c | |
parent | e3b63a7910ac7a4ee959af20a544075becbf2671 (diff) | |
download | binutils-3fcbae9d9c7cdc4103c4f494f5d3c63b373617ee.zip binutils-3fcbae9d9c7cdc4103c4f494f5d3c63b373617ee.tar.gz binutils-3fcbae9d9c7cdc4103c4f494f5d3c63b373617ee.tar.bz2 |
gdb: use gdb::checked_static_cast when casting lm_info
Now that the lm_info class hierarchy has a virtual destructor and
therefore a vtable, use checked_static_cast instead of C-style cases to
ensure (when building in dev mode) that we're casting to the right kind
of lm_info.
Change-Id: I9a99b7d6aa9a44edbe76377d57a7008cfb75a744
Approved-By: Pedro Alves <pedro@palves.net>
Reviewed-By: Reviewed-By: Lancelot Six <lancelot.six@amd.com>
Diffstat (limited to 'gdb/solib-darwin.c')
-rw-r--r-- | gdb/solib-darwin.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gdb/solib-darwin.c b/gdb/solib-darwin.c index 7d36d79..78a27ec 100644 --- a/gdb/solib-darwin.c +++ b/gdb/solib-darwin.c @@ -614,7 +614,7 @@ darwin_clear_solib (program_space *pspace) static void darwin_relocate_section_addresses (so_list &so, target_section *sec) { - lm_info_darwin *li = (lm_info_darwin *) so.lm_info; + auto *li = gdb::checked_static_cast<lm_info_darwin *> (so.lm_info); sec->addr += li->lm_addr; sec->endaddr += li->lm_addr; |