diff options
author | Siddhesh Poyarekar <siddhesh@sourceware.org> | 2012-08-24 03:57:22 +0000 |
---|---|---|
committer | Siddhesh Poyarekar <siddhesh@sourceware.org> | 2012-08-24 03:57:22 +0000 |
commit | ecfb0d68c570de8a5e29858d104d82a76982de15 (patch) | |
tree | f9c92bc9004a0809c534981af704cfb6c0428656 /gdb/h8300-tdep.c | |
parent | e7d50cc9e6af53a13f3a3140795d7b5065e8fe33 (diff) | |
download | gdb-ecfb0d68c570de8a5e29858d104d82a76982de15.zip gdb-ecfb0d68c570de8a5e29858d104d82a76982de15.tar.gz gdb-ecfb0d68c570de8a5e29858d104d82a76982de15.tar.bz2 |
* 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 237f4a3..7fc4daa 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. */ |