use xzalloc in ada-lang.c:replace_operator_with_call
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.
This commit is contained in:
parent
0e8ad34f4d
commit
8c1a34e7f5
2 changed files with 6 additions and 1 deletions
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue