This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
PATCH: extend 'buffer' lifetime to enclose all its uses
- From: Jim Blandy <jimb at redhat dot com>
- To: gdb-patches at sources dot redhat dot com
- Date: 13 Sep 2004 21:51:58 -0500
- Subject: 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)