From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6735 invoked by alias); 14 Sep 2004 02:52:34 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 6728 invoked from network); 14 Sep 2004 02:52:34 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org with SMTP; 14 Sep 2004 02:52:34 -0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.12.11/8.12.10) with ESMTP id i8E2qXKr007873 for ; Mon, 13 Sep 2004 22:52:33 -0400 Received: from zenia.home.redhat.com (porkchop.devel.redhat.com [172.16.58.2]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i8E2qVr22100; Mon, 13 Sep 2004 22:52:32 -0400 To: gdb-patches@sources.redhat.com Subject: PATCH: extend 'buffer' lifetime to enclose all its uses From: Jim Blandy Date: Tue, 14 Sep 2004 02:52:00 -0000 Message-ID: User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2004-09/txt/msg00223.txt.bz2 Committed as obvious. 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. 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)