diff options
author | siddhesh <siddhesh> | 2012-08-24 03:57:22 +0000 |
---|---|---|
committer | siddhesh <siddhesh> | 2012-08-24 03:57:22 +0000 |
commit | 3c9f743f7cbc3e5a5474ae896465a3b4b55b56af (patch) | |
tree | 4036f5aca7ac73bc9ed5ef48db2efe647f691a5e /gdb/h8300-tdep.c | |
parent | 21ebaf891ac164159ff2c16537947a2dedb96570 (diff) | |
download | gdb-3c9f743f7cbc3e5a5474ae896465a3b4b55b56af.tar.gz |
* h8300-tdep.c (h8300_push_dummy_call): Replace unsafe alloca
with xmalloc/cleanup.
* mt-tdep.c (mt_push_dummy_call): Likewise.
* tilegx-tdep.c (tilegx_push_dummy_call): Likewise.
* xstormy16-tdep.c (xstormy16_push_dummy_call): Likewise.
Diffstat (limited to 'gdb/h8300-tdep.c')
-rw-r--r-- | gdb/h8300-tdep.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/gdb/h8300-tdep.c b/gdb/h8300-tdep.c index 237f4a3be8a..7fc4daadc84 100644 --- a/gdb/h8300-tdep.c +++ b/gdb/h8300-tdep.c @@ -666,13 +666,15 @@ h8300_push_dummy_call (struct gdbarch *gdbarch, struct value *function, for (argument = 0; argument < nargs; argument++) { + struct cleanup *back_to; struct type *type = value_type (args[argument]); int len = TYPE_LENGTH (type); char *contents = (char *) value_contents (args[argument]); /* Pad the argument appropriately. */ int padded_len = align_up (len, wordsize); - gdb_byte *padded = alloca (padded_len); + gdb_byte *padded = xmalloc (padded_len); + back_to = make_cleanup (xfree, padded); memset (padded, 0, padded_len); memcpy (len < wordsize ? padded + padded_len - len : padded, @@ -720,6 +722,8 @@ h8300_push_dummy_call (struct gdbarch *gdbarch, struct value *function, subsequent arguments go on the stack. */ reg = E_ARGLAST_REGNUM + 1; } + + do_cleanups (back_to); } /* Store return address. */ |