This is the mail archive of the gdb-patches@sources.redhat.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]
Other format: [Raw text]

PATCH: extend 'buffer' lifetime to enclose all its uses


Committed as obvious.

2004-09-13  Jim Blandy  <jimb@redhat.com>

	* valops.c (value_assign): Move 'buffer' to the enclosing block,
	so that its storage isn't referenced after its lifetime ends.

Index: gdb/valops.c
===================================================================
RCS file: /cvs/src/src/gdb/valops.c,v
retrieving revision 1.129
diff -c -p -r1.129 valops.c
*** gdb/valops.c	3 Aug 2004 00:57:27 -0000	1.129
--- gdb/valops.c	14 Sep 2004 02:47:56 -0000
*************** value_assign (struct value *toval, struc
*** 569,578 ****
  	char *dest_buffer;
  	CORE_ADDR changed_addr;
  	int changed_len;
  
  	if (VALUE_BITSIZE (toval))
  	  {
- 	    char buffer[sizeof (LONGEST)];
  	    /* We assume that the argument to read_memory is in units of
  	       host chars.  FIXME:  Is that correct?  */
  	    changed_len = (VALUE_BITPOS (toval)
--- 569,578 ----
  	char *dest_buffer;
  	CORE_ADDR changed_addr;
  	int changed_len;
+         char buffer[sizeof (LONGEST)];
  
  	if (VALUE_BITSIZE (toval))
  	  {
  	    /* We assume that the argument to read_memory is in units of
  	       host chars.  FIXME:  Is that correct?  */
  	    changed_len = (VALUE_BITPOS (toval)


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