]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blobdiff - gdb/m88k-tdep.c
Replace some xmalloc-family functions with XNEW-family ones
[thirdparty/binutils-gdb.git] / gdb / m88k-tdep.c
index 57754672917929a60d4c851f302d8c21fb59c52e..47a8f579fd347dc46037b82f02f8131a4f82763f 100644 (file)
@@ -533,11 +533,9 @@ m88k_analyze_prologue (struct gdbarch *gdbarch,
   /* Provide a dummy cache if necessary.  */
   if (cache == NULL)
     {
-      size_t sizeof_saved_regs =
-       (M88K_R31_REGNUM + 1) * sizeof (struct trad_frame_saved_reg);
-
-      cache = alloca (sizeof (struct m88k_frame_cache));
-      cache->saved_regs = alloca (sizeof_saved_regs);
+      cache->saved_regs
+       = XALLOCAVEC (struct trad_frame_saved_reg, M88K_R31_REGNUM + 1);
+      cache = XALLOCA (struct m88k_frame_cache);
 
       /* We only initialize the members we care about.  */
       cache->saved_regs[M88K_R1_REGNUM].addr = -1;