Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:27474 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 55167 invoked by uid 1010); 15 Jan 2007 23:18:16 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 55152 invoked from network); 15 Jan 2007 23:18:16 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 15 Jan 2007 23:18:16 -0000 Authentication-Results: pb1.pair.com smtp.mail=derick@php.net; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=derick@php.net; sender-id=unknown Received-SPF: error (pb1.pair.com: domain php.net from 82.94.239.5 cause and error) X-PHP-List-Original-Sender: derick@php.net X-Host-Fingerprint: 82.94.239.5 jdi.jdi-ict.nl Linux 2.5 (sometimes 2.4) (4) Received: from [82.94.239.5] ([82.94.239.5:56244] helo=jdi.jdi-ict.nl) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 01/76-33655-7BB0CA54 for ; Mon, 15 Jan 2007 18:18:15 -0500 Received: from localhost (localhost [127.0.0.1]) by jdi.jdi-ict.nl (8.13.7/8.12.11) with ESMTP id l0FNICAj016896; Tue, 16 Jan 2007 00:18:12 +0100 Date: Tue, 16 Jan 2007 00:17:04 +0100 (CET) X-X-Sender: derick@localhost To: Marcus Boerger cc: PHP Developers Mailing List In-Reply-To: <287851093.20070115233131@marcus-boerger.de> Message-ID: References: <287851093.20070115233131@marcus-boerger.de> X-Face: "L'&?Ah3MYF@FB4hU'XhNhLB]222(Lbr2Y@F:GE[OO;"F5p>qtFBl|yVVA&D{A(g3[C}mG:199P+5C'v.M/u@Z\![0b:Mv.[l6[uWl' MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Subject: Re: [PHP-DEV] [RFC] Help debugging overloaded objects From: derick@php.net (Derick Rethans) On Mon, 15 Jan 2007, Marcus Boerger wrote: > Any comments? Shouldn't you init is_temp here? As far as I can see it is not initialized in every code path, and there is an if() using it in the 3rd patch element here: > @@ -581,6 +581,7 @@ ZEND_API void zend_print_zval_r_ex(zend_ > HashTable *properties = NULL; > zstr class_name = NULL_ZSTR; > zend_uint clen; > + int is_temp; > > > if (Z_OBJ_HANDLER_P(expr, get_class_name)) { > Z_OBJ_HANDLER_P(expr, get_class_name)(expr, &class_name, &clen, 0 TSRMLS_CC); > @@ -593,8 +594,11 @@ ZEND_API void zend_print_zval_r_ex(zend_ > if (class_name.v) { > efree(class_name.v); > } > - if (Z_OBJ_HANDLER_P(expr, get_properties)) { > + if (Z_OBJ_HANDLER_P(expr, get_debug_info)) { > + properties = Z_OBJ_HANDLER_P(expr, get_debug_info)(expr, &is_temp TSRMLS_CC); > + } else if (Z_OBJ_HANDLER_P(expr, get_properties)) { > properties = Z_OBJPROP_P(expr); > + is_temp = 0; > } > if (properties) { > if (++properties->nApplyCount>1) { > @@ -604,6 +608,10 @@ ZEND_API void zend_print_zval_r_ex(zend_ > } > print_hash(properties, indent, 1 TSRMLS_CC); > properties->nApplyCount--; > + if (is_temp) { > + zend_hash_destroy(properties); > + efree(properties); > + } > } > break; > } regards, Derick -- Derick Rethans http://derickrethans.nl | http://ez.no | http://xdebug.org