Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:27692 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 52726 invoked by uid 1010); 27 Jan 2007 17:32:57 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 52711 invoked from network); 27 Jan 2007 17:32:57 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 27 Jan 2007 17:32:57 -0000 X-Host-Fingerprint: 80.123.98.46 unknown Received: from [80.123.98.46] ([80.123.98.46:9813] helo=localhost.localdomain) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 13/C0-32805-8CC8BB54 for ; Sat, 27 Jan 2007 12:32:56 -0500 Message-ID: <13.C0.32805.8CC8BB54@pb1.pair.com> To: internals@lists.php.net Date: Sat, 27 Jan 2007 18:32:54 +0100 User-Agent: Thunderbird 1.5.0.9 (X11/20070103) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="------------020401020101030401080906" X-Posted-By: 80.123.98.46 Subject: [PATCH] fix zend_llist_remove_tail From: mike@php.net (Michael Wallner) --------------020401020101030401080906 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit The attached patch fixes zend_llist_remove_tail() which didn't reset zend_llist->head properly. The diff was generated against 5_2. Regards, -- Michael --------------020401020101030401080906 Content-Type: text/plain; name="zend_llist.5_2.diff.txt" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="zend_llist.5_2.diff.txt" 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; } --------------020401020101030401080906--