Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:43972 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 5071 invoked from network); 15 May 2009 08:03:07 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 15 May 2009 08:03:07 -0000 Authentication-Results: pb1.pair.com smtp.mail=tony@daylessday.org; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=tony@daylessday.org; sender-id=pass Received-SPF: pass (pb1.pair.com: domain daylessday.org designates 89.208.40.236 as permitted sender) X-PHP-List-Original-Sender: tony@daylessday.org X-Host-Fingerprint: 89.208.40.236 mail.daylessday.org Linux 2.6 Received: from [89.208.40.236] ([89.208.40.236:40537] helo=daylessday.org) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id CF/BB-27038-9B12D0A4 for ; Fri, 15 May 2009 04:03:07 -0400 Received: from [192.168.3.68] (unknown [212.42.62.198]) by daylessday.org (Postfix) with ESMTPSA id 55C85BFA101; Fri, 15 May 2009 12:03:01 +0400 (MSD) Message-ID: <4A0D21B4.3000804@daylessday.org> Date: Fri, 15 May 2009 12:03:00 +0400 User-Agent: Thunderbird 2.0.0.19 (X11/20081227) MIME-Version: 1.0 To: Farley Knight CC: internals@lists.php.net References: In-Reply-To: X-Enigmail-Version: 0.95.6 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Segfault while looping through hash table From: tony@daylessday.org (Antony Dovgal) On 15.05.2009 07:31, Farley Knight wrote: > while (zend_hash_get_current_data(Z_ARRVAL(zhash), (void**)&value) > == SUCCESS) { > current++; > printf("Currently on entry %d\n", current); > if (zend_hash_move_forward(Z_ARRVAL(zhash)) == SUCCESS) > printf("Done moving hash forward. Result was successful\n"); > else > printf("Done moving hash forward. Result was a failure\n"); > } What's the point of this if() ? You continue reading the values even if move_forward() fails (i.e. the end is reached). -- Wbr, Antony Dovgal