From commits-return-6736-apmail-apr-commits-archive=apr.apache.org@apr.apache.org Wed May 04 12:21:51 2005 Return-Path: Delivered-To: apmail-apr-commits-archive@www.apache.org Received: (qmail 39294 invoked from network); 4 May 2005 12:21:51 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 4 May 2005 12:21:51 -0000 Received: (qmail 36957 invoked by uid 500); 4 May 2005 12:23:36 -0000 Delivered-To: apmail-apr-commits-archive@apr.apache.org Received: (qmail 36929 invoked by uid 500); 4 May 2005 12:23:36 -0000 Mailing-List: contact commits-help@apr.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Reply-To: dev@apr.apache.org Delivered-To: mailing list commits@apr.apache.org Received: (qmail 36907 invoked by uid 99); 4 May 2005 12:23:35 -0000 X-ASF-Spam-Status: No, hits=0.2 required=10.0 tests=NO_REAL_NAME X-Spam-Check-By: apache.org Received: from minotaur.apache.org (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.28) with SMTP; Wed, 04 May 2005 05:23:35 -0700 Received: (qmail 39095 invoked by uid 65534); 4 May 2005 12:21:21 -0000 Message-ID: <20050504122121.39094.qmail@minotaur.apache.org> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Subject: svn commit: r168118 - in /apr/apr/trunk: CHANGES tables/apr_tables.c Date: Wed, 04 May 2005 12:21:20 -0000 To: commits@apr.apache.org From: jorton@apache.org X-Mailer: svnmailer-1.0.0-dev X-Virus-Checked: Checked X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Author: jorton Date: Wed May 4 05:21:19 2005 New Revision: 168118 URL: http://svn.apache.org/viewcvs?rev=3D168118&view=3Drev Log: * tables/apr_tables.c (apr_table_overlap): Don't erase dest table array if the pools differ; add pool-lifetime debugging check. Submitted by: Joe Schaefer Modified: apr/apr/trunk/CHANGES apr/apr/trunk/tables/apr_tables.c Modified: apr/apr/trunk/CHANGES URL: http://svn.apache.org/viewcvs/apr/apr/trunk/CHANGES?rev=3D168118&r1=3D= 168117&r2=3D168118&view=3Ddiff =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- apr/apr/trunk/CHANGES (original) +++ apr/apr/trunk/CHANGES Wed May 4 05:21:19 2005 @@ -1,5 +1,8 @@ Changes for APR 1.2.0 =20 + *) Fix apr_table_overlap()'s handling of tables allocated from + different pools. [Joe Schaefer ] + *) Add support for uuid_generate on OS X 10.4. [Paul Querna] =20 *) Include the C preprocessor flags in --cflags for pkg-config. Modified: apr/apr/trunk/tables/apr_tables.c URL: http://svn.apache.org/viewcvs/apr/apr/trunk/tables/apr_tables.c?rev=3D= 168118&r1=3D168117&r2=3D168118&view=3Ddiff =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- apr/apr/trunk/tables/apr_tables.c (original) +++ apr/apr/trunk/tables/apr_tables.c Wed May 4 05:21:19 2005 @@ -1191,18 +1191,18 @@ APR_DECLARE(void) apr_table_overlap(apr_table_t *a, const apr_table_t *b, unsigned flags) { - const int m =3D a->a.nelts; - const int n =3D b->a.nelts; - apr_pool_t *p =3D b->a.pool; - - if (m + n =3D=3D 0) { + if (a->a.nelts + b->a.nelts =3D=3D 0) { return; } =20 - /* copy (extend) a using b's pool */ - if (a->a.pool !=3D p) { - make_array_core(&a->a, p, m+n, sizeof(apr_table_entry_t), 0); +#if APR_POOL_DEBUG + /* Since the keys and values are not copied, it's required that + * b->a.pool has a lifetime at least as long as a->a.pool. */ + if (!apr_pool_is_ancestor(b->a.pool, a->a.pool)) { + fprintf(stderr, "apr_table_overlap: b's pool is not an ancestor of= a's\n"); + abort(); } +#endif =20 apr_table_cat(a, b); =20