From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16999 invoked by alias); 18 Oct 2002 21:08:00 -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 16970 invoked from network); 18 Oct 2002 21:07:56 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sources.redhat.com with SMTP; 18 Oct 2002 21:07:56 -0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.11.6/8.11.6) with ESMTP id g9IKkuw24351 for ; Fri, 18 Oct 2002 16:46:56 -0400 Received: from pobox.corp.redhat.com (pobox.corp.redhat.com [172.16.52.156]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id g9IL7uf12264 for ; Fri, 18 Oct 2002 17:07:56 -0400 Received: from localhost.redhat.com (IDENT:UOKGruHstymHgv2WYWJBjljuC5IvNXJB@tooth.toronto.redhat.com [172.16.14.29]) by pobox.corp.redhat.com (8.11.6/8.11.6) with ESMTP id g9IL7tT09883 for ; Fri, 18 Oct 2002 17:07:55 -0400 Received: by localhost.redhat.com (Postfix, from userid 469) id 8F913FF79; Fri, 18 Oct 2002 17:05:14 -0400 (EDT) From: Elena Zannoni MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <15792.30602.54384.850513@localhost.redhat.com> Date: Fri, 18 Oct 2002 14:08:00 -0000 To: Pierre Muller Cc: gdb-patches@sources.redhat.com Subject: Re: [RFA] Fix an error in value_change_enclosing_type In-Reply-To: <5.0.2.1.2.20021007132114.01e66260@ics.u-strasbg.fr> References: <5.0.2.1.2.20021007132114.01e66260@ics.u-strasbg.fr> X-SW-Source: 2002-10/txt/msg00306.txt.bz2 Pierre Muller writes: > > > > the function value_change_enclosing_type > does not set the enlclosing_type field correctly if > the new_encl_type has a bigger length that the value type. > > Its seems quite astonishing that this has not been noticed before, > but I discovered it when trying to get > the fpc-abi.c code to work correctly. > The fix seems OK. However, do you have a small testcase? It would be good to add it to the testsuite. Does this fix changes the results for the already existing tests? thanks Elena > ChangeLog entry: > > 2002-10-07 Pierre Muller > > * values.c (value_change_enclosing_type): Set > enclosing_type field correctly also for the case where > more memory needs to be allocated. > > > $ cvs diff -u -p values.c > Index: values.c > =================================================================== > RCS file: /cvs/src/src/gdb/values.c,v > retrieving revision 1.41 > diff -u -p -r1.41 values.c > --- values.c 18 Sep 2002 15:43:47 -0000 1.41 > +++ values.c 7 Oct 2002 11:36:15 -0000 > @@ -862,7 +862,9 @@ value_change_enclosing_type (struct valu > struct value *prev; > > new_val = (struct value *) xrealloc (val, sizeof (struct value) + TYPE_LENGTH (new_encl_type)); > - > + > + VALUE_ENCLOSING_TYPE (new_val) = new_encl_type; > + > /* We have to make sure this ends up in the same place in the value > chain as the original copy, so it's clean-up behavior is the same. > If the value has been released, this is a waste of time, but there > > > Pierre Muller > Institut Charles Sadron > 6,rue Boussingault > F 67083 STRASBOURG CEDEX (France) > mailto:muller@ics.u-strasbg.fr > Phone : (33)-3-88-41-40-07 Fax : (33)-3-88-41-40-99