From 3fcbae9d9c7cdc4103c4f494f5d3c63b373617ee Mon Sep 17 00:00:00 2001 From: Simon Marchi Date: Tue, 10 Oct 2023 14:03:18 -0400 Subject: 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 Reviewed-By: Reviewed-By: Lancelot Six --- gdb/solib-darwin.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gdb/solib-darwin.c') 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 (so.lm_info); sec->addr += li->lm_addr; sec->endaddr += li->lm_addr; -- cgit v1.1