aboutsummaryrefslogtreecommitdiff
path: root/gdb/disasm.c
diff options
context:
space:
mode:
authorTom Tromey <tromey@adacore.com>2022-08-17 11:47:17 -0600
committerTom Tromey <tromey@adacore.com>2022-09-12 14:25:06 -0600
commit5f48d886a9ce0b7d109a26c860adf66330ca65cf (patch)
tree27ac0194e55feb3eb8a4a1ea9541fa4cec0c6652 /gdb/disasm.c
parent29a6701e530a4119d3c0d261da2b7b24034c9233 (diff)
downloadgdb-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/disasm.c')
-rw-r--r--gdb/disasm.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/gdb/disasm.c b/gdb/disasm.c
index fe4eed2..989120e 100644
--- a/gdb/disasm.c
+++ b/gdb/disasm.c
@@ -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;