Fix crash when creating index from index
[binutils-gdb.git] / gdb / sh-netbsd-tdep.c
index eabec984ced6f7f72ae2bdbb2404297727a7d05a..4fbb53b49fffb467fb6d29e6dd70072fa2a830a5 100644 (file)
@@ -1,6 +1,6 @@
 /* Target-dependent code for NetBSD/sh.
 
-   Copyright (C) 2002-2020 Free Software Foundation, Inc.
+   Copyright (C) 2002-2022 Free Software Foundation, Inc.
 
    Contributed by Wasabi Systems, Inc.
 
@@ -61,9 +61,9 @@ static const struct sh_corefile_regmap regmap[] =
 
 static void
 shnbsd_init_abi (struct gdbarch_info info,
-                  struct gdbarch *gdbarch)
+                 struct gdbarch *gdbarch)
 {
-  struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+  sh_gdbarch_tdep *tdep = (sh_gdbarch_tdep *) gdbarch_tdep (gdbarch);
   nbsd_init_abi (info, gdbarch);
 
   tdep->core_gregmap = (struct sh_corefile_regmap *)regmap;