use xzalloc in ada-lang.c:replace_operator_with_call
authorJoel Brobecker <brobecker@gnat.com>
Mon, 21 Mar 2011 14:43:14 +0000 (14:43 +0000)
committerJoel Brobecker <brobecker@gnat.com>
Mon, 21 Mar 2011 14:43:14 +0000 (14:43 +0000)
This is to make sure that we cannot have a field with an undefined
value (currently, we are not setting the gdbarch).

gdb/ChangeLog:

* ada-lang.c (replace_operator_with_call): Use xzalloc instead
of xmalloc.

gdb/ChangeLog
gdb/ada-lang.c

index 64d8391..d79197e 100644 (file)
@@ -1,3 +1,8 @@
+2012-03-21  Joel Brobecker  <brobecker@adacore.com>
+
+       * ada-lang.c (replace_operator_with_call): Use xzalloc instead
+       of xmalloc.
+
 2012-03-18  Pedro Alves  <pedro@codesourcery.com>
 
        * frame.c (frame_unwind_register): Throw an error if unwinding the
index ed51ab0..392ffea 100644 (file)
@@ -3655,7 +3655,7 @@ replace_operator_with_call (struct expression **expp, int pc, int nargs,
   /* A new expression, with 6 more elements (3 for funcall, 4 for function
      symbol, -oplen for operator being replaced).  */
   struct expression *newexp = (struct expression *)
-    xmalloc (sizeof (struct expression)
+    xzalloc (sizeof (struct expression)
              + EXP_ELEM_TO_BYTES ((*expp)->nelts + 7 - oplen));
   struct expression *exp = *expp;