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.
This commit is contained in:
Tom Tromey
2022-08-17 11:47:17 -06:00
parent 29a6701e53
commit 5f48d886a9
7 changed files with 14 additions and 22 deletions

View File

@@ -246,8 +246,7 @@ gdb_printing_disassembler::stream_from_gdb_disassemble_info (void *dis_info)
{
gdb_disassemble_info *di = (gdb_disassemble_info *) dis_info;
gdb_printing_disassembler *dis
= dynamic_cast<gdb_printing_disassembler *> (di);
gdb_assert (dis != nullptr);
= gdb::checked_static_cast<gdb_printing_disassembler *> (di);
ui_file *stream = dis->stream ();
gdb_assert (stream != nullptr);
return stream;