* valops.c (value_assign): Move 'buffer' to the enclosing block,
authorJim Blandy <jimb@codesourcery.com>
Tue, 14 Sep 2004 02:51:27 +0000 (02:51 +0000)
committerJim Blandy <jimb@codesourcery.com>
Tue, 14 Sep 2004 02:51:27 +0000 (02:51 +0000)
so that its storage isn't referenced after its lifetime ends.

gdb/ChangeLog
gdb/valops.c

index 43cdb4f3bbc3ddfba9f311b8a4135c8b0af1800e..a832382457f7d53a2528418289b8e6ed9be5d8bc 100644 (file)
@@ -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.
index ac50d23b070a7b1ce573bb33ed0b43eba55292e8..6e825ac382f44a1458b9a882ca0e9ec53137dbb6 100644 (file)
@@ -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)