aboutsummaryrefslogtreecommitdiff
path: root/gdb/i386-tdep.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/i386-tdep.c')
-rw-r--r--gdb/i386-tdep.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c
index dc3cbed..580664d 100644
--- a/gdb/i386-tdep.c
+++ b/gdb/i386-tdep.c
@@ -8452,7 +8452,6 @@ i386_type_align (struct gdbarch *gdbarch, struct type *type)
static struct gdbarch *
i386_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
{
- struct gdbarch *gdbarch;
const struct target_desc *tdesc;
int mm0_regnum;
int ymm0_regnum;
@@ -8465,8 +8464,9 @@ i386_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
return arches->gdbarch;
/* Allocate space for the new architecture. Assume i386 for now. */
- i386_gdbarch_tdep *tdep = new i386_gdbarch_tdep;
- gdbarch = gdbarch_alloc (&info, tdep);
+ gdbarch *gdbarch
+ = gdbarch_alloc (&info, gdbarch_tdep_up (new i386_gdbarch_tdep));
+ i386_gdbarch_tdep *tdep = gdbarch_tdep<i386_gdbarch_tdep> (gdbarch);
/* General-purpose registers. */
tdep->gregset_reg_offset = NULL;
@@ -8709,7 +8709,6 @@ i386_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
if (!i386_validate_tdesc_p (tdep, tdesc_data.get ()))
{
- delete tdep;
gdbarch_free (gdbarch);
return NULL;
}