From 696576715e5355fa389275405e401115bc02089f Mon Sep 17 00:00:00 2001 From: Jim Blandy Date: Tue, 14 Sep 2004 02:51:27 +0000 Subject: [PATCH] * valops.c (value_assign): Move 'buffer' to the enclosing block, so that its storage isn't referenced after its lifetime ends. --- gdb/ChangeLog | 5 +++++ gdb/valops.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 43cdb4f3bbc..a832382457f 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2004-09-13 Jim Blandy + + * 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 * configure.in (frags): Replace TM_FILE with DEPRECATED_TM_FILE. diff --git a/gdb/valops.c b/gdb/valops.c index ac50d23b070..6e825ac382f 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) -- 2.30.2