From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16448 invoked by alias); 26 Jun 2009 17:24:18 -0000 Received: (qmail 16430 invoked by uid 22791); 26 Jun 2009 17:24:17 -0000 X-SWARE-Spam-Status: No, hits=-2.3 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mx2.redhat.com (HELO mx2.redhat.com) (66.187.237.31) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 26 Jun 2009 17:24:10 +0000 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id n5QHO7AK032183; Fri, 26 Jun 2009 13:24:07 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx2.corp.redhat.com (8.13.1/8.13.1) with ESMTP id n5QHO6iU013335; Fri, 26 Jun 2009 13:24:06 -0400 Received: from opsy.redhat.com (vpn-225-10.phx2.redhat.com [10.3.225.10]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id n5QHO5TE014326; Fri, 26 Jun 2009 13:24:05 -0400 Received: by opsy.redhat.com (Postfix, from userid 500) id CA2C0508250; Fri, 26 Jun 2009 11:24:04 -0600 (MDT) To: "Ulrich Weigand" Cc: jan.kratochvil@redhat.com (Jan Kratochvil), gdb-patches@sourceware.org Subject: Re: [patch] [3/5] Types reference counting [make_function_type-objfile] References: <20090626163927.GA14063@host0.dyn.jankratochvil.net> <200906261712.n5QHCXOh026222@d12av02.megacenter.de.ibm.com> From: Tom Tromey Reply-To: tromey@redhat.com Date: Fri, 26 Jun 2009 17:24:00 -0000 In-Reply-To: <200906261712.n5QHCXOh026222@d12av02.megacenter.de.ibm.com> (Ulrich Weigand's message of "Fri\, 26 Jun 2009 19\:12\:33 +0200 \(CEST\)") Message-ID: User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2009-06/txt/msg00747.txt.bz2 >>>>> "Ulrich" == Ulrich Weigand writes: Ulrich> Mostly. We still can have the case were TYPE_OBJFILE(A) is NULL but Ulrich> TYPE_OBJFILE(B) is non-NULL, for example where A is a temporary array Ulrich> and B the element type. Ulrich> The way I see the invariant is Ulrich> If Type A references Type B *and* A is objfile-associated Ulrich> *then* B must be associated to the same objfile Suppose we have A as an array type with a NULL objfile, and with element type B, which has an objfile. If we have a convenience variable of type A, and the objfile is deleted, I don't think preserve_values will copy type B. That is because we only check the value's immediate objfile to decide whether we need to do a type copy. Therefore it seems to me that the invariant must be TYPE_OBJFILE(A) == TYPE_OBJFILE(B), for all related types A and B. Tom