aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Blandy <jimb@codesourcery.com>2004-09-14 02:51:27 +0000
committerJim Blandy <jimb@codesourcery.com>2004-09-14 02:51:27 +0000
commit696576715e5355fa389275405e401115bc02089f (patch)
tree610520ba6e7e93cd14e59235585168ad0f113e48
parent79fadcb076b30e154a8e6981c9cae4b2bdd6e952 (diff)
downloadgdb-696576715e5355fa389275405e401115bc02089f.zip
gdb-696576715e5355fa389275405e401115bc02089f.tar.gz
gdb-696576715e5355fa389275405e401115bc02089f.tar.bz2
* valops.c (value_assign): Move 'buffer' to the enclosing block,
so that its storage isn't referenced after its lifetime ends.
-rw-r--r--gdb/ChangeLog5
-rw-r--r--gdb/valops.c2
2 files changed, 6 insertions, 1 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 43cdb4f..a832382 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,8 @@
+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.
+
2004-09-13 Andrew Cagney <cagney@gnu.org>
* configure.in (frags): Replace TM_FILE with DEPRECATED_TM_FILE.
diff --git a/gdb/valops.c b/gdb/valops.c
index ac50d23..6e825ac 100644
--- a/gdb/valops.c
+++ b/gdb/valops.c
@@ -569,10 +569,10 @@ value_assign (struct value *toval, struct value *fromval)
char *dest_buffer;
CORE_ADDR changed_addr;
int changed_len;
+ char buffer[sizeof (LONGEST)];
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)