From cf93a3aa81daf4908cb3fa51fe34054542ebcbb6 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Thu, 9 Apr 1998 23:21:14 +0000 Subject: [PATCH] * mips-tdep.c (do_fp_register_row): Use alloca rather than arrays with dynamic size. --- gdb/ChangeLog | 5 +++++ gdb/mips-tdep.c | 8 ++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index f4ecc103809..b7ae2aa697b 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +Thu Apr 9 19:20:32 1998 Ian Lance Taylor + + * mips-tdep.c (do_fp_register_row): Use alloca rather than arrays + with dynamic size. + Wed Apr 8 19:21:42 1998 Jason Molenda (crash@bugshack.cygnus.com) * top.c (print_gdb_version): Print 1998 now. diff --git a/gdb/mips-tdep.c b/gdb/mips-tdep.c index dc033a9a570..948c8b50858 100644 --- a/gdb/mips-tdep.c +++ b/gdb/mips-tdep.c @@ -1700,14 +1700,18 @@ static int do_fp_register_row (regnum) int regnum; { /* do values for FP (float) regs */ - char raw_buffer[2] [REGISTER_RAW_SIZE(FP0_REGNUM)]; - char dbl_buffer[2 * REGISTER_RAW_SIZE(FP0_REGNUM)]; + char *raw_buffer[2]; + char *dbl_buffer; /* use HI and LO to control the order of combining two flt regs */ int HI = (TARGET_BYTE_ORDER == BIG_ENDIAN); int LO = (TARGET_BYTE_ORDER != BIG_ENDIAN); double doub, flt1, flt2; /* doubles extracted from raw hex data */ int inv1, inv2, inv3; + raw_buffer[0] = (char *) alloca (REGISTER_RAW_SIZE (FP0_REGNUM)); + raw_buffer[1] = (char *) alloca (REGISTER_RAW_SIZE (FP0_REGNUM)); + dbl_buffer = (char *) alloca (2 * REGISTER_RAW_SIZE (FP0_REGNUM)); + /* Get the data in raw format. */ if (read_relative_register_raw_bytes (regnum, raw_buffer[HI])) error ("can't read register %d (%s)", regnum, reg_names[regnum]); -- 2.30.2