Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:27728 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 8011 invoked by uid 1010); 2 Feb 2007 17:18:47 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 7995 invoked from network); 2 Feb 2007 17:18:47 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 2 Feb 2007 17:18:47 -0000 X-Host-Fingerprint: 80.123.98.46 unknown Received: from [80.123.98.46] ([80.123.98.46:25499] helo=localhost.localdomain) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 59/56-18640-67273C54 for ; Fri, 02 Feb 2007 12:18:46 -0500 Message-ID: <59.56.18640.67273C54@pb1.pair.com> To: internals@lists.php.net Date: Fri, 02 Feb 2007 18:19:08 +0100 User-Agent: Thunderbird 1.5.0.9 (X11/20070103) MIME-Version: 1.0 References: <13.C0.32805.8CC8BB54@pb1.pair.com> In-Reply-To: <13.C0.32805.8CC8BB54@pb1.pair.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Posted-By: 80.123.98.46 Subject: Re: [PATCH] fix zend_llist_remove_tail From: mike@php.net (Michael Wallner) *If* anybody's wondering... I don't have karma. Michael Wallner wrote: > The attached patch fixes zend_llist_remove_tail() which didn't reset zend_llist->head properly. > The diff was generated against 5_2. > > Regards, > > > ------------------------------------------------------------------------ > > Index: Zend/zend_llist.c > =================================================================== > RCS file: /repository/ZendEngine2/zend_llist.c,v > retrieving revision 1.35.2.1.2.1 > diff -u -p -d -r1.35.2.1.2.1 zend_llist.c > --- Zend/zend_llist.c 1 Jan 2007 09:35:46 -0000 1.35.2.1.2.1 > +++ Zend/zend_llist.c 27 Jan 2007 17:31:36 -0000 > @@ -130,28 +130,17 @@ ZEND_API void zend_llist_clean(zend_llis > > ZEND_API void *zend_llist_remove_tail(zend_llist *l) > { > - zend_llist_element *old_tail; > + zend_llist_element *current = l->tail; > void *data; > - > - if ((old_tail = l->tail)) { > - if (l->tail->prev) { > - l->tail->prev->next = NULL; > - } > - > - data = old_tail->data; > - > - l->tail = l->tail->prev; > - if (l->dtor) { > - l->dtor(data); > - } > - pefree(old_tail, l->persistent); > - > - --l->count; > - > - return data; > + > + if (current) { > + data = current->data; > + DEL_LLIST_ELEMENT(current, l); > + } else { > + data = NULL; > } > - > - return NULL; > + > + return data; > } > > -- Michael