Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:21726 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 46706 invoked by uid 1010); 29 Jan 2006 21:01:29 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 46691 invoked from network); 29 Jan 2006 21:01:29 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 29 Jan 2006 21:01:29 -0000 X-Host-Fingerprint: 81.169.145.165 natsmtp00.rzone.de Solaris 8 (1) Received: from ([81.169.145.165:47997] helo=natsmtp00.rzone.de) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id 69/45-33179-82D2DD34 for ; Sun, 29 Jan 2006 16:01:29 -0500 Received: from [192.168.1.77] (p508764A6.dip.t-dialin.net [80.135.100.166]) by post.webmailer.de (8.13.1/8.13.1) with ESMTP id k0TL1LrJ010020 for ; Sun, 29 Jan 2006 22:01:23 +0100 (MET) Message-ID: <43DD2D20.5010001@php.net> Date: Sun, 29 Jan 2006 22:01:20 +0100 User-Agent: Mozilla Thunderbird 1.0.6 (Windows/20050716) X-Accept-Language: en-us, en MIME-Version: 1.0 To: PHP internals X-Enigmail-Version: 0.93.0.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: zend_hash.c fishy code From: sesser@php.net (Stefan Esser) Good Morning, I wonder If I am completely missing the point, but the following piece of code seems fishy to me: ZEND_API int zend_hash_del_key_or_index(HashTable *ht, char *arKey, uint nKeyLength, ulong h, int flag) { uint nIndex; Bucket *p; ... while (p != NULL) { if ((p->h == h) && ((p->nKeyLength == 0) || /* Numeric index */ ((p->nKeyLength == nKeyLength) && (!memcmp(p->arKey, arKey, nKeyLength))))) { HANDLE_BLOCK_INTERRUPTIONS(); ... If I am not completely mistaken this means: If this is a bucket with a numeric index with the hash value of the key we want to delete, then delete it, even when we wanted to delete a key with a string as index. Stefan