This is the mail archive of the gdb-patches@sourceware.cygnus.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

mips-tdep.c: bad size passed to memcpy in do_fp_register_row



It was pointed out to me that I needed more info in the subject, to
make sure the right people saw this patch.  No other changes.

2000-04-12  DJ Delorie  <dj@cygnus.com>

	* mips-tdep.c (do_fp_register_row): copy the number of bytes
	allocated, not the size of the pointer.


Index: mips-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/mips-tdep.c,v
retrieving revision 1.3
diff -p -3 -r1.3 mips-tdep.c
*** mips-tdep.c	2000/04/09 14:35:35	1.3
--- mips-tdep.c	2000/04/12 15:52:07
*************** do_fp_register_row (regnum)
*** 2510,2516 ****
  	       regnum + 1, REGISTER_NAME (regnum + 1));
  
        /* copy the two floats into one double, and unpack both */
!       memcpy (dbl_buffer, raw_buffer, sizeof (dbl_buffer));
        flt1 = unpack_double (builtin_type_float, raw_buffer[HI], &inv1);
        flt2 = unpack_double (builtin_type_float, raw_buffer[LO], &inv2);
        doub = unpack_double (builtin_type_double, dbl_buffer, &inv3);
--- 2510,2516 ----
  	       regnum + 1, REGISTER_NAME (regnum + 1));
  
        /* copy the two floats into one double, and unpack both */
!       memcpy (dbl_buffer, raw_buffer, 2 * REGISTER_RAW_SIZE (FP0_REGNUM));
        flt1 = unpack_double (builtin_type_float, raw_buffer[HI], &inv1);
        flt2 = unpack_double (builtin_type_float, raw_buffer[LO], &inv2);
        doub = unpack_double (builtin_type_double, dbl_buffer, &inv3);
*************** do_fp_register_row (regnum)
*** 2528,2534 ****
      {				/* eight byte registers: print each one as float AND as double. */
        int offset = 4 * (TARGET_BYTE_ORDER == BIG_ENDIAN);
  
!       memcpy (dbl_buffer, raw_buffer[HI], sizeof (dbl_buffer));
        flt1 = unpack_double (builtin_type_float,
  			    &raw_buffer[HI][offset], &inv1);
        doub = unpack_double (builtin_type_double, dbl_buffer, &inv3);
--- 2528,2534 ----
      {				/* eight byte registers: print each one as float AND as double. */
        int offset = 4 * (TARGET_BYTE_ORDER == BIG_ENDIAN);
  
!       memcpy (dbl_buffer, raw_buffer[HI], 2 * REGISTER_RAW_SIZE (FP0_REGNUM));
        flt1 = unpack_double (builtin_type_float,
  			    &raw_buffer[HI][offset], &inv1);
        doub = unpack_double (builtin_type_double, dbl_buffer, &inv3);


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]