tony2001                Wed Mar 29 14:28:43 2006 UTC

  Modified files:              (Branch: PHP_5_1)
    /php-src    NEWS 
    /ZendEngine2        zend_objects.c zend_objects.h 
    /php-src/ext/com_dotnet     com_persist.c 
    /php-src/ext/date   php_date.c 
    /php-src/ext/dom    php_dom.c 
    /php-src/ext/mysqli mysqli.c 
    /php-src/ext/reflection     php_reflection.c 
    /php-src/ext/simplexml      simplexml.c 
    /php-src/ext/spl    spl_array.c spl_directory.c spl_iterators.c 
                        spl_observer.c 
    /php-src/ext/sqlite sqlite.c 
    /php-src/ext/tidy   tidy.c 
    /php-src/ext/xmlreader      php_xmlreader.c 
    /php-src/ext/xmlwriter      php_xmlwriter.c 
    /php-src/ext/xsl    php_xsl.c 
  Log:
  fix bug #36898 (__set() leaks in classes extending internal ones)
  
  Added:
  ZEND_API void zend_object_std_init(zend_object *object, zend_class_entry *ce 
TSRMLS_DC)
  ZEND_API void zend_object_std_dtor(zend_object *object TSRMLS_DC)
  
  to initialize and destroy zend_object structs
  
  
http://cvs.php.net/viewcvs.cgi/php-src/NEWS?r1=1.2027.2.487&r2=1.2027.2.488&diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.487 php-src/NEWS:1.2027.2.488
--- php-src/NEWS:1.2027.2.487   Tue Mar 28 16:01:04 2006
+++ php-src/NEWS        Wed Mar 29 14:28:40 2006
@@ -12,6 +12,8 @@
 - Removed the E_STRICT deprecation notice from "var". (Ilia)
 - Fixed debug_zval_dump() to support private and protected members. (Dmitry)
 - Fixed SoapFault::getMessage(). (Dmitry)
+- Fixed bug #36898 (__set() leaks in classes extending internal ones). 
+  (Tony, Dmitry)
 - Fixed bug #36886 (User filters can leak buckets in some situations). (Ilia)
 - Fixed bug #36878 (error messages are printed even though an exception has 
   been thrown). (Tony)
http://cvs.php.net/viewcvs.cgi/ZendEngine2/zend_objects.c?r1=1.56.2.2&r2=1.56.2.3&diff_format=u
Index: ZendEngine2/zend_objects.c
diff -u ZendEngine2/zend_objects.c:1.56.2.2 ZendEngine2/zend_objects.c:1.56.2.3
--- ZendEngine2/zend_objects.c:1.56.2.2 Wed Jan  4 23:53:04 2006
+++ ZendEngine2/zend_objects.c  Wed Mar 29 14:28:40 2006
@@ -17,7 +17,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: zend_objects.c,v 1.56.2.2 2006/01/04 23:53:04 andi Exp $ */
+/* $Id: zend_objects.c,v 1.56.2.3 2006/03/29 14:28:40 tony2001 Exp $ */
 
 #include "zend.h"
 #include "zend_globals.h"
@@ -25,6 +25,26 @@
 #include "zend_API.h"
 #include "zend_interfaces.h"
 
+ZEND_API void zend_object_std_init(zend_object *object, zend_class_entry *ce 
TSRMLS_DC)
+{
+       ALLOC_HASHTABLE(object->properties);
+       zend_hash_init(object->properties, 0, NULL, ZVAL_PTR_DTOR, 0);
+
+       object->ce = ce;        
+       object->guards = NULL;
+}
+
+ZEND_API void zend_object_std_dtor(zend_object *object TSRMLS_DC)
+{
+       if (object->guards) {
+               zend_hash_destroy(object->guards);
+               FREE_HASHTABLE(object->guards);         
+       }
+       if (object->properties) {
+               zend_hash_destroy(object->properties);
+               FREE_HASHTABLE(object->properties);
+       }
+}
 
 ZEND_API void zend_objects_destroy_object(zend_object *object, 
zend_object_handle handle TSRMLS_DC)
 {
@@ -88,12 +108,7 @@
 
 ZEND_API void zend_objects_free_object_storage(zend_object *object TSRMLS_DC)
 {
-       if (object->guards) {
-               zend_hash_destroy(object->guards);
-               FREE_HASHTABLE(object->guards);         
-       }
-       zend_hash_destroy(object->properties);
-       FREE_HASHTABLE(object->properties);
+       zend_object_std_dtor(object TSRMLS_CC);
        efree(object);
 }
 
http://cvs.php.net/viewcvs.cgi/ZendEngine2/zend_objects.h?r1=1.25.2.1&r2=1.25.2.2&diff_format=u
Index: ZendEngine2/zend_objects.h
diff -u ZendEngine2/zend_objects.h:1.25.2.1 ZendEngine2/zend_objects.h:1.25.2.2
--- ZendEngine2/zend_objects.h:1.25.2.1 Wed Jan  4 23:53:04 2006
+++ ZendEngine2/zend_objects.h  Wed Mar 29 14:28:40 2006
@@ -17,7 +17,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: zend_objects.h,v 1.25.2.1 2006/01/04 23:53:04 andi Exp $ */
+/* $Id: zend_objects.h,v 1.25.2.2 2006/03/29 14:28:40 tony2001 Exp $ */
 
 #ifndef ZEND_OBJECTS_H
 #define ZEND_OBJECTS_H
@@ -25,6 +25,8 @@
 #include "zend.h"
 
 BEGIN_EXTERN_C()
+ZEND_API void zend_object_std_init(zend_object *object, zend_class_entry *ce 
TSRMLS_DC);
+ZEND_API void zend_object_std_dtor(zend_object *object TSRMLS_DC);
 ZEND_API zend_object_value zend_objects_new(zend_object **object, 
zend_class_entry *class_type TSRMLS_DC);
 ZEND_API void zend_objects_destroy_object(zend_object *object, 
zend_object_handle handle TSRMLS_DC);
 ZEND_API zend_object *zend_objects_get_address(zval *object TSRMLS_DC);
http://cvs.php.net/viewcvs.cgi/php-src/ext/com_dotnet/com_persist.c?r1=1.5.2.2&r2=1.5.2.3&diff_format=u
Index: php-src/ext/com_dotnet/com_persist.c
diff -u php-src/ext/com_dotnet/com_persist.c:1.5.2.2 
php-src/ext/com_dotnet/com_persist.c:1.5.2.3
--- php-src/ext/com_dotnet/com_persist.c:1.5.2.2        Wed Feb  1 07:41:24 2006
+++ php-src/ext/com_dotnet/com_persist.c        Wed Mar 29 14:28:41 2006
@@ -16,7 +16,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: com_persist.c,v 1.5.2.2 2006/02/01 07:41:24 sebastian Exp $ */
+/* $Id: com_persist.c,v 1.5.2.3 2006/03/29 14:28:41 tony2001 Exp $ */
 
 /* Infrastructure for working with persistent COM objects.
  * Implements: IStream* wrapper for PHP streams.
@@ -708,8 +708,7 @@
        if (object->unk) {
                IUnknown_Release(object->unk);
        }
-       zend_hash_destroy(object->std.properties);
-       FREE_HASHTABLE(object->std.properties);
+       zend_object_std_dtor(&object->std TSRMLS_CC);
        efree(object);
 }
 
@@ -722,9 +721,8 @@
        memcpy(clone, object, sizeof(*object));
        *clone_ptr = clone;
 
-       ALLOC_HASHTABLE(clone->std.properties);
-       zend_hash_init(clone->std.properties, 0, NULL, ZVAL_PTR_DTOR, 0);
-       
+       zend_object_std_init(&clone->std, object->std.ce TSRMLS_CC);
+
        if (clone->ipf) {
                IPersistFile_AddRef(clone->ipf);
        }
@@ -747,9 +745,7 @@
        helper = emalloc(sizeof(*helper));
        memset(helper, 0, sizeof(*helper));
 
-       ALLOC_HASHTABLE(helper->std.properties);
-       zend_hash_init(helper->std.properties, 0, NULL, ZVAL_PTR_DTOR, 0);
-       helper->std.ce = helper_ce;
+       zend_object_std_init(&helper->std, helper_ce TSRMLS_CC);
        
        retval.handle = zend_objects_store_put(helper, NULL, 
helper_free_storage, helper_clone TSRMLS_CC);
        retval.handlers = &helper_handlers;
http://cvs.php.net/viewcvs.cgi/php-src/ext/date/php_date.c?r1=1.43.2.43&r2=1.43.2.44&diff_format=u
Index: php-src/ext/date/php_date.c
diff -u php-src/ext/date/php_date.c:1.43.2.43 
php-src/ext/date/php_date.c:1.43.2.44
--- php-src/ext/date/php_date.c:1.43.2.43       Sat Mar 18 23:43:48 2006
+++ php-src/ext/date/php_date.c Wed Mar 29 14:28:41 2006
@@ -16,7 +16,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: php_date.c,v 1.43.2.43 2006/03/18 23:43:48 tony2001 Exp $ */
+/* $Id: php_date.c,v 1.43.2.44 2006/03/29 14:28:41 tony2001 Exp $ */
 
 #include "php.h"
 #include "php_streams.h"
@@ -1230,10 +1230,8 @@
 
        intern = emalloc(sizeof(php_date_obj));
        memset(intern, 0, sizeof(php_date_obj));
-       intern->std.ce = class_type;
        
-       ALLOC_HASHTABLE(intern->std.properties);
-       zend_hash_init(intern->std.properties, 0, NULL, ZVAL_PTR_DTOR, 0);
+       zend_object_std_init(&intern->std, class_type TSRMLS_CC);
        zend_hash_copy(intern->std.properties, &class_type->default_properties, 
(copy_ctor_func_t) zval_add_ref, (void *) &tmp, sizeof(zval *));
        
        retval.handle = zend_objects_store_put(intern, 
(zend_objects_store_dtor_t)zend_objects_destroy_object, 
(zend_objects_free_object_storage_t) date_object_free_storage_date, NULL 
TSRMLS_CC);
@@ -1250,10 +1248,8 @@
 
        intern = emalloc(sizeof(php_timezone_obj));
        memset(intern, 0, sizeof(php_timezone_obj));
-       intern->std.ce = class_type;
 
-       ALLOC_HASHTABLE(intern->std.properties);
-       zend_hash_init(intern->std.properties, 0, NULL, ZVAL_PTR_DTOR, 0);
+       zend_object_std_init(&intern->std, class_type TSRMLS_CC);
        zend_hash_copy(intern->std.properties, &class_type->default_properties, 
(copy_ctor_func_t) zval_add_ref, (void *) &tmp, sizeof(zval *));
        
        retval.handle = zend_objects_store_put(intern, 
(zend_objects_store_dtor_t)zend_objects_destroy_object, 
(zend_objects_free_object_storage_t) date_object_free_storage_timezone, NULL 
TSRMLS_CC);
@@ -1273,12 +1269,7 @@
                timelib_time_dtor(intern->time);
        }
 
-       if (intern->std.properties) {
-               zend_hash_destroy(intern->std.properties);
-               efree(intern->std.properties);
-               intern->std.properties = NULL;
-       }
-       
+       zend_object_std_dtor(&intern->std TSRMLS_CC);
        efree(object);
 }
 
@@ -1286,12 +1277,7 @@
 {
        php_timezone_obj *intern = (php_timezone_obj *)object;
 
-       if (intern->std.properties) {
-               zend_hash_destroy(intern->std.properties);
-               efree(intern->std.properties);
-               intern->std.properties = NULL;
-       }
-
+       zend_object_std_dtor(&intern->std TSRMLS_CC);
        efree(object);
 }
 
http://cvs.php.net/viewcvs.cgi/php-src/ext/dom/php_dom.c?r1=1.73.2.10&r2=1.73.2.11&diff_format=u
Index: php-src/ext/dom/php_dom.c
diff -u php-src/ext/dom/php_dom.c:1.73.2.10 php-src/ext/dom/php_dom.c:1.73.2.11
--- php-src/ext/dom/php_dom.c:1.73.2.10 Sun Mar 26 00:23:25 2006
+++ php-src/ext/dom/php_dom.c   Wed Mar 29 14:28:41 2006
@@ -18,7 +18,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: php_dom.c,v 1.73.2.10 2006/03/26 00:23:25 tony2001 Exp $ */
+/* $Id: php_dom.c,v 1.73.2.11 2006/03/29 14:28:41 tony2001 Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -906,8 +906,7 @@
 {
        dom_object *intern = (dom_object *)object;
 
-       zend_hash_destroy(intern->std.properties);
-       FREE_HASHTABLE(intern->std.properties);
+       zend_object_std_dtor(&intern->std TSRMLS_CC);
 
        if (intern->ptr != NULL) {
                xmlXPathFreeContext((xmlXPathContextPtr) intern->ptr);
@@ -926,8 +925,7 @@
        dom_object *intern = (dom_object *)object;
        int retcount;
 
-       zend_hash_destroy(intern->std.properties);
-       FREE_HASHTABLE(intern->std.properties);
+       zend_object_std_dtor(&intern->std TSRMLS_CC);
 
        if (intern->ptr != NULL && ((php_libxml_node_ptr *)intern->ptr)->node 
!= NULL) {
                if (((xmlNodePtr) ((php_libxml_node_ptr 
*)intern->ptr)->node)->type != XML_DOCUMENT_NODE && ((xmlNodePtr) 
((php_libxml_node_ptr *)intern->ptr)->node)->type != XML_HTML_DOCUMENT_NODE) {
@@ -973,8 +971,6 @@
        dom_object *intern;
 
        intern = emalloc(sizeof(dom_object));
-       intern->std.ce = class_type;
-       intern->std.guards = NULL;
        intern->ptr = NULL;
        intern->prop_handler = NULL;
        intern->document = NULL;
@@ -986,8 +982,7 @@
 
        zend_hash_find(&classes, base_class->name, base_class->name_length + 1, 
(void **) &intern->prop_handler);
 
-       ALLOC_HASHTABLE(intern->std.properties);
-       zend_hash_init(intern->std.properties, 0, NULL, ZVAL_PTR_DTOR, 0);
+       zend_object_std_init(&intern->std, class_type TSRMLS_CC);
        if (hash_copy) {
                zend_hash_copy(intern->std.properties, 
&class_type->default_properties, (copy_ctor_func_t) zval_add_ref, (void *) 
&tmp, sizeof(zval *));
        }
@@ -1092,8 +1087,7 @@
 
        php_libxml_decrement_doc_ref((php_libxml_node_object *)intern 
TSRMLS_CC);
 
-       zend_hash_destroy(intern->std.properties);
-       FREE_HASHTABLE(intern->std.properties);
+       zend_object_std_dtor(&intern->std TSRMLS_CC);
 
        efree(object);
 }
http://cvs.php.net/viewcvs.cgi/php-src/ext/mysqli/mysqli.c?r1=1.72.2.12&r2=1.72.2.13&diff_format=u
Index: php-src/ext/mysqli/mysqli.c
diff -u php-src/ext/mysqli/mysqli.c:1.72.2.12 
php-src/ext/mysqli/mysqli.c:1.72.2.13
--- php-src/ext/mysqli/mysqli.c:1.72.2.12       Fri Mar 24 12:10:38 2006
+++ php-src/ext/mysqli/mysqli.c Wed Mar 29 14:28:42 2006
@@ -15,7 +15,7 @@
   | Author: Georg Richter <[EMAIL PROTECTED]>                                |
   +----------------------------------------------------------------------+
 
-  $Id: mysqli.c,v 1.72.2.12 2006/03/24 12:10:38 georg Exp $ 
+  $Id: mysqli.c,v 1.72.2.13 2006/03/29 14:28:42 tony2001 Exp $ 
 */
 
 #ifdef HAVE_CONFIG_H
@@ -123,8 +123,9 @@
 static void mysqli_objects_free_storage(zend_object *object TSRMLS_DC)
 {
        mysqli_object   *intern = (mysqli_object *)object;
-       
-       zend_objects_free_object_storage(&(intern->zo) TSRMLS_CC);
+
+       zend_object_std_dtor(&intern->zo TSRMLS_CC);
+       efree(intern);
 }
 /* }}} */
 
@@ -332,8 +333,6 @@
 
        intern = emalloc(sizeof(mysqli_object));
        memset(intern, 0, sizeof(mysqli_object));
-       intern->zo.ce = class_type;
-       intern->zo.guards = NULL;
        intern->ptr = NULL;
        intern->prop_handler = NULL;
 
@@ -345,8 +344,7 @@
        zend_hash_find(&classes, mysqli_base_class->name, 
mysqli_base_class->name_length + 1, 
                                        (void **) &intern->prop_handler);
 
-       ALLOC_HASHTABLE(intern->zo.properties);
-       zend_hash_init(intern->zo.properties, 0, NULL, ZVAL_PTR_DTOR, 0);
+       zend_object_std_init(&intern->std, class_type TSRMLS_CC);
        zend_hash_copy(intern->zo.properties, &class_type->default_properties, 
(copy_ctor_func_t) zval_add_ref,
                                        (void *) &tmp, sizeof(zval *));
 
http://cvs.php.net/viewcvs.cgi/php-src/ext/reflection/php_reflection.c?r1=1.164.2.32&r2=1.164.2.33&diff_format=u
Index: php-src/ext/reflection/php_reflection.c
diff -u php-src/ext/reflection/php_reflection.c:1.164.2.32 
php-src/ext/reflection/php_reflection.c:1.164.2.33
--- php-src/ext/reflection/php_reflection.c:1.164.2.32  Sun Mar 12 17:22:34 2006
+++ php-src/ext/reflection/php_reflection.c     Wed Mar 29 14:28:42 2006
@@ -20,7 +20,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: php_reflection.c,v 1.164.2.32 2006/03/12 17:22:34 helly Exp $ */
+/* $Id: php_reflection.c,v 1.164.2.33 2006/03/29 14:28:42 tony2001 Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -240,9 +240,7 @@
        reflection_object **intern_clone = (reflection_object **) object_clone;
 
        *intern_clone = emalloc(sizeof(reflection_object));
-       (*intern_clone)->zo.ce = intern->zo.ce;
-       (*intern_clone)->zo.guards = NULL;
-       ALLOC_HASHTABLE((*intern_clone)->zo.properties);
+       zend_object_std_init(&(*intern_clone)->zo, intern->zo.ce TSRMLS_CC);
        (*intern_clone)->ptr = intern->ptr;
        (*intern_clone)->free_ptr = intern->free_ptr;
        (*intern_clone)->obj = intern->obj;
@@ -264,8 +262,7 @@
        intern->obj = NULL;
        intern->free_ptr = 0;
 
-       ALLOC_HASHTABLE(intern->zo.properties);
-       zend_hash_init(intern->zo.properties, 0, NULL, ZVAL_PTR_DTOR, 0);
+       zend_object_std_init(&intern->zo, class_type TSRMLS_CC);
        zend_hash_copy(intern->zo.properties, &class_type->default_properties, 
(copy_ctor_func_t) zval_add_ref, (void *) &tmp, sizeof(zval *));
        retval.handle = zend_objects_store_put(intern, NULL, 
reflection_free_objects_storage, reflection_objects_clone TSRMLS_CC);
        retval.handlers = &reflection_object_handlers;
@@ -4488,7 +4485,7 @@
        php_info_print_table_start();
        php_info_print_table_header(2, "Reflection", "enabled");
 
-       php_info_print_table_row(2, "Version", "$Id: php_reflection.c,v 
1.164.2.32 2006/03/12 17:22:34 helly Exp $");
+       php_info_print_table_row(2, "Version", "$Id: php_reflection.c,v 
1.164.2.33 2006/03/29 14:28:42 tony2001 Exp $");
 
        php_info_print_table_end();
 } /* }}} */
http://cvs.php.net/viewcvs.cgi/php-src/ext/simplexml/simplexml.c?r1=1.151.2.18&r2=1.151.2.19&diff_format=u
Index: php-src/ext/simplexml/simplexml.c
diff -u php-src/ext/simplexml/simplexml.c:1.151.2.18 
php-src/ext/simplexml/simplexml.c:1.151.2.19
--- php-src/ext/simplexml/simplexml.c:1.151.2.18        Tue Mar  7 15:22:48 2006
+++ php-src/ext/simplexml/simplexml.c   Wed Mar 29 14:28:42 2006
@@ -18,7 +18,7 @@
   +----------------------------------------------------------------------+
 */
 
-/* $Id: simplexml.c,v 1.151.2.18 2006/03/07 15:22:48 rrichards Exp $ */
+/* $Id: simplexml.c,v 1.151.2.19 2006/03/29 14:28:42 tony2001 Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -1785,9 +1785,8 @@
 
        sxe = (php_sxe_object *) object;
 
-       zend_hash_destroy(sxe->zo.properties);
-       FREE_HASHTABLE(sxe->zo.properties);
-
+       zend_object_std_dtor(&sxe->zo TSRMLS_CC);
+       
        php_libxml_node_decrement_resource((php_libxml_node_object *)sxe 
TSRMLS_CC);
 
        if (sxe->xpath) {
@@ -1810,14 +1809,12 @@
        php_sxe_object *intern;
 
        intern = ecalloc(1, sizeof(php_sxe_object));
-       intern->zo.ce = ce;
 
        intern->iter.type = SXE_ITER_NONE;
        intern->iter.nsprefix = NULL;
        intern->iter.name = NULL;
 
-       ALLOC_HASHTABLE(intern->zo.properties);
-       zend_hash_init(intern->zo.properties, 0, NULL, ZVAL_PTR_DTOR, 0);
+       zend_object_std_init(&intern->zo, ce TSRMLS_CC);
 
        return intern;
 }
@@ -2290,7 +2287,7 @@
 {
        php_info_print_table_start();
        php_info_print_table_header(2, "Simplexml support", "enabled");
-       php_info_print_table_row(2, "Revision", "$Revision: 1.151.2.18 $");
+       php_info_print_table_row(2, "Revision", "$Revision: 1.151.2.19 $");
        php_info_print_table_row(2, "Schema support",
 #ifdef LIBXML_SCHEMAS_ENABLED
                "enabled");
http://cvs.php.net/viewcvs.cgi/php-src/ext/spl/spl_array.c?r1=1.71.2.13&r2=1.71.2.14&diff_format=u
Index: php-src/ext/spl/spl_array.c
diff -u php-src/ext/spl/spl_array.c:1.71.2.13 
php-src/ext/spl/spl_array.c:1.71.2.14
--- php-src/ext/spl/spl_array.c:1.71.2.13       Thu Mar 23 11:42:32 2006
+++ php-src/ext/spl/spl_array.c Wed Mar 29 14:28:42 2006
@@ -16,7 +16,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: spl_array.c,v 1.71.2.13 2006/03/23 11:42:32 dmitry Exp $ */
+/* $Id: spl_array.c,v 1.71.2.14 2006/03/29 14:28:42 tony2001 Exp $ */
 
 #ifdef HAVE_CONFIG_H
 # include "config.h"
@@ -103,8 +103,7 @@
 {
        spl_array_object *intern = (spl_array_object *)object;
 
-       zend_hash_destroy(intern->std.properties);
-       FREE_HASHTABLE(intern->std.properties);
+       zend_object_std_dtor(&intern->std TSRMLS_CC);
 
        zval_ptr_dtor(&intern->array);
        zval_ptr_dtor(&intern->retval);
@@ -124,12 +123,10 @@
 
        intern = emalloc(sizeof(spl_array_object));
        memset(intern, 0, sizeof(spl_array_object));
-       intern->std.ce = class_type;
        *obj = intern;
        ALLOC_INIT_ZVAL(intern->retval);
 
-       ALLOC_HASHTABLE(intern->std.properties);
-       zend_hash_init(intern->std.properties, 0, NULL, ZVAL_PTR_DTOR, 0);
+       zend_object_std_init(&intern->std, class_type TSRMLS_CC);
        zend_hash_copy(intern->std.properties, &class_type->default_properties, 
(copy_ctor_func_t) zval_add_ref, (void *) &tmp, sizeof(zval *));
 
        intern->ar_flags = 0;
http://cvs.php.net/viewcvs.cgi/php-src/ext/spl/spl_directory.c?r1=1.45.2.25&r2=1.45.2.26&diff_format=u
Index: php-src/ext/spl/spl_directory.c
diff -u php-src/ext/spl/spl_directory.c:1.45.2.25 
php-src/ext/spl/spl_directory.c:1.45.2.26
--- php-src/ext/spl/spl_directory.c:1.45.2.25   Mon Mar 20 13:54:16 2006
+++ php-src/ext/spl/spl_directory.c     Wed Mar 29 14:28:42 2006
@@ -16,7 +16,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: spl_directory.c,v 1.45.2.25 2006/03/20 13:54:16 tony2001 Exp $ */
+/* $Id: spl_directory.c,v 1.45.2.26 2006/03/29 14:28:42 tony2001 Exp $ */
 
 #ifdef HAVE_CONFIG_H
 # include "config.h"
@@ -73,9 +73,9 @@
        if (intern->oth_handler && intern->oth_handler->dtor) {
                intern->oth_handler->dtor(intern TSRMLS_CC);
        }
-       zend_hash_destroy(intern->std.properties);
-       FREE_HASHTABLE(intern->std.properties);
-
+       
+       zend_object_std_dtor(&intern->std TSRMLS_CC);
+       
        if (intern->path) {
                efree(intern->path);
        }
@@ -132,14 +132,12 @@
 
        intern = emalloc(sizeof(spl_filesystem_object));
        memset(intern, 0, sizeof(spl_filesystem_object));
-       intern->std.ce = class_type;
        /* intern->type = SPL_FS_INFO; done by set 0 */
        intern->file_class = spl_ce_SplFileObject;
        intern->info_class = spl_ce_SplFileInfo;
        if (obj) *obj = intern;
 
-       ALLOC_HASHTABLE(intern->std.properties);
-       zend_hash_init(intern->std.properties, 0, NULL, ZVAL_PTR_DTOR, 0);
+       zend_object_std_init(&intern->std, class_type TSRMLS_CC);
        zend_hash_copy(intern->std.properties, &class_type->default_properties, 
(copy_ctor_func_t) zval_add_ref, (void *) &tmp, sizeof(zval *));
 
        retval.handle = zend_objects_store_put(intern, 
(zend_objects_store_dtor_t) zend_objects_destroy_object, 
(zend_objects_free_object_storage_t) spl_filesystem_object_free_storage, NULL 
TSRMLS_CC);
http://cvs.php.net/viewcvs.cgi/php-src/ext/spl/spl_iterators.c?r1=1.73.2.28&r2=1.73.2.29&diff_format=u
Index: php-src/ext/spl/spl_iterators.c
diff -u php-src/ext/spl/spl_iterators.c:1.73.2.28 
php-src/ext/spl/spl_iterators.c:1.73.2.29
--- php-src/ext/spl/spl_iterators.c:1.73.2.28   Sun Mar 26 02:25:03 2006
+++ php-src/ext/spl/spl_iterators.c     Wed Mar 29 14:28:42 2006
@@ -16,7 +16,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: spl_iterators.c,v 1.73.2.28 2006/03/26 02:25:03 helly Exp $ */
+/* $Id: spl_iterators.c,v 1.73.2.29 2006/03/29 14:28:42 tony2001 Exp $ */
 
 #ifdef HAVE_CONFIG_H
 # include "config.h"
@@ -670,8 +670,7 @@
                object->iterators = NULL;
        }
 
-       zend_hash_destroy(object->std.properties);
-       FREE_HASHTABLE(object->std.properties);
+       zend_object_std_dtor(&object->std TSRMLS_CC);
 
        efree(object);
 }
@@ -686,10 +685,8 @@
 
        intern = emalloc(sizeof(spl_recursive_it_object));
        memset(intern, 0, sizeof(spl_recursive_it_object));
-       intern->std.ce = class_type;
 
-       ALLOC_HASHTABLE(intern->std.properties);
-       zend_hash_init(intern->std.properties, 0, NULL, ZVAL_PTR_DTOR, 0);
+       zend_object_std_init(&intern->std, class_type TSRMLS_CC);
        zend_hash_copy(intern->std.properties, &class_type->default_properties, 
(copy_ctor_func_t) zval_add_ref, (void *) &tmp, sizeof(zval *));
 
        retval.handle = zend_objects_store_put(intern, 
(zend_objects_store_dtor_t)zend_objects_destroy_object, 
(zend_objects_free_object_storage_t) 
spl_RecursiveIteratorIterator_free_storage, NULL TSRMLS_CC);
@@ -1271,8 +1268,7 @@
                zval_ptr_dtor(&object->u.append.zarrayit);
        }
 
-       zend_hash_destroy(object->std.properties);
-       FREE_HASHTABLE(object->std.properties);
+       zend_object_std_dtor(&object->std TSRMLS_CC);
 
        efree(object);
 }
@@ -1287,11 +1283,9 @@
 
        intern = emalloc(sizeof(spl_dual_it_object));
        memset(intern, 0, sizeof(spl_dual_it_object));
-       intern->std.ce = class_type;
        intern->dit_type = DIT_Unknown;
 
-       ALLOC_HASHTABLE(intern->std.properties);
-       zend_hash_init(intern->std.properties, 0, NULL, ZVAL_PTR_DTOR, 0);
+       zend_object_std_init(&intern->std, class_type TSRMLS_CC);
        zend_hash_copy(intern->std.properties, &class_type->default_properties, 
(copy_ctor_func_t) zval_add_ref, (void *) &tmp, sizeof(zval *));
 
        retval.handle = zend_objects_store_put(intern, 
(zend_objects_store_dtor_t)zend_objects_destroy_object, 
(zend_objects_free_object_storage_t) spl_dual_it_free_storage, NULL TSRMLS_CC);
http://cvs.php.net/viewcvs.cgi/php-src/ext/spl/spl_observer.c?r1=1.2.2.5&r2=1.2.2.6&diff_format=u
Index: php-src/ext/spl/spl_observer.c
diff -u php-src/ext/spl/spl_observer.c:1.2.2.5 
php-src/ext/spl/spl_observer.c:1.2.2.6
--- php-src/ext/spl/spl_observer.c:1.2.2.5      Sun Jan  1 12:50:14 2006
+++ php-src/ext/spl/spl_observer.c      Wed Mar 29 14:28:42 2006
@@ -16,7 +16,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: spl_observer.c,v 1.2.2.5 2006/01/01 12:50:14 sniper Exp $ */
+/* $Id: spl_observer.c,v 1.2.2.6 2006/03/29 14:28:42 tony2001 Exp $ */
 
 #ifdef HAVE_CONFIG_H
 # include "config.h"
@@ -85,9 +85,8 @@
 {
        spl_SplObjectStorage *intern = (spl_SplObjectStorage *)object;
 
-       zend_hash_destroy(intern->std.properties);
-       FREE_HASHTABLE(intern->std.properties);
-
+       zend_object_std_dtor(&intern->std TSRMLS_CC);
+       
        zend_hash_destroy(&intern->storage);
 
        efree(object);
@@ -101,11 +100,9 @@
 
        intern = emalloc(sizeof(spl_SplObjectStorage));
        memset(intern, 0, sizeof(spl_SplObjectStorage));
-       intern->std.ce = class_type;
        *obj = intern;
 
-       ALLOC_HASHTABLE(intern->std.properties);
-       zend_hash_init(intern->std.properties, 0, NULL, ZVAL_PTR_DTOR, 0);
+       zend_object_std_init(&intern->std, class_type TSRMLS_CC);
        zend_hash_copy(intern->std.properties, &class_type->default_properties, 
(copy_ctor_func_t) zval_add_ref, (void *) &tmp, sizeof(zval *));
 
        zend_hash_init(&intern->storage, 0, NULL, ZVAL_PTR_DTOR, 0);
http://cvs.php.net/viewcvs.cgi/php-src/ext/sqlite/sqlite.c?r1=1.166.2.11&r2=1.166.2.12&diff_format=u
Index: php-src/ext/sqlite/sqlite.c
diff -u php-src/ext/sqlite/sqlite.c:1.166.2.11 
php-src/ext/sqlite/sqlite.c:1.166.2.12
--- php-src/ext/sqlite/sqlite.c:1.166.2.11      Sun Jan  1 12:50:14 2006
+++ php-src/ext/sqlite/sqlite.c Wed Mar 29 14:28:42 2006
@@ -17,7 +17,7 @@
    |          Marcus Boerger <[EMAIL PROTECTED]>                              |
    +----------------------------------------------------------------------+
 
-   $Id: sqlite.c,v 1.166.2.11 2006/01/01 12:50:14 sniper Exp $
+   $Id: sqlite.c,v 1.166.2.12 2006/03/29 14:28:42 tony2001 Exp $
 */
 
 #ifdef HAVE_CONFIG_H
@@ -802,8 +802,7 @@
 {
        sqlite_object *intern = (sqlite_object *)object;
 
-       zend_hash_destroy(intern->std.properties);
-       FREE_HASHTABLE(intern->std.properties);
+       zend_object_std_dtor(&intern->std TSRMLS_CC);
 
        if (intern->u.ptr) {
                if (intern->type == is_db) {
@@ -826,10 +825,8 @@
 
        intern = emalloc(sizeof(sqlite_object));
        memset(intern, 0, sizeof(sqlite_object));
-       intern->std.ce = class_type;
 
-       ALLOC_HASHTABLE(intern->std.properties);
-       zend_hash_init(intern->std.properties, 0, NULL, ZVAL_PTR_DTOR, 0);
+       zend_object_std_init(&intern->std, class_type TSRMLS_CC);
        zend_hash_copy(intern->std.properties, &class_type->default_properties, 
(copy_ctor_func_t) zval_add_ref, (void *) &tmp, sizeof(zval *));
 
        retval->handle = zend_objects_store_put(intern, 
(zend_objects_store_dtor_t)zend_objects_destroy_object, 
(zend_objects_free_object_storage_t) sqlite_object_free_storage, NULL 
TSRMLS_CC);
@@ -1127,7 +1124,7 @@
 {
        php_info_print_table_start();
        php_info_print_table_header(2, "SQLite support", "enabled");
-       php_info_print_table_row(2, "PECL Module version", 
PHP_SQLITE_MODULE_VERSION " $Id: sqlite.c,v 1.166.2.11 2006/01/01 12:50:14 
sniper Exp $");
+       php_info_print_table_row(2, "PECL Module version", 
PHP_SQLITE_MODULE_VERSION " $Id: sqlite.c,v 1.166.2.12 2006/03/29 14:28:42 
tony2001 Exp $");
        php_info_print_table_row(2, "SQLite Library", sqlite_libversion());
        php_info_print_table_row(2, "SQLite Encoding", sqlite_libencoding());
        php_info_print_table_end();
http://cvs.php.net/viewcvs.cgi/php-src/ext/tidy/tidy.c?r1=1.66.2.5&r2=1.66.2.6&diff_format=u
Index: php-src/ext/tidy/tidy.c
diff -u php-src/ext/tidy/tidy.c:1.66.2.5 php-src/ext/tidy/tidy.c:1.66.2.6
--- php-src/ext/tidy/tidy.c:1.66.2.5    Sun Jan  1 12:50:16 2006
+++ php-src/ext/tidy/tidy.c     Wed Mar 29 14:28:42 2006
@@ -16,7 +16,7 @@
   +----------------------------------------------------------------------+
 */
 
-/* $Id: tidy.c,v 1.66.2.5 2006/01/01 12:50:16 sniper Exp $ */
+/* $Id: tidy.c,v 1.66.2.6 2006/03/29 14:28:42 tony2001 Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -530,8 +530,7 @@
 {
        PHPTidyObj *intern = (PHPTidyObj *)object;
 
-       zend_hash_destroy(intern->std.properties);
-       FREE_HASHTABLE(intern->std.properties);
+       zend_object_std_dtor(&intern->std TSRMLS_CC);
 
        if (intern->ptdoc) {
                intern->ptdoc->ref_count--;
@@ -555,10 +554,8 @@
 
        intern = emalloc(sizeof(PHPTidyObj));
        memset(intern, 0, sizeof(PHPTidyObj));
-       intern->std.ce = class_type;
 
-       ALLOC_HASHTABLE(intern->std.properties);
-       zend_hash_init(intern->std.properties, 0, NULL, ZVAL_PTR_DTOR, 0);
+       zend_object_std_init(&intern->std, class_type TSRMLS_CC);
        zend_hash_copy(intern->std.properties, &class_type->default_properties, 
(copy_ctor_func_t) zval_add_ref, (void *) &tmp, sizeof(zval *));
 
        switch(objtype) {
@@ -983,7 +980,7 @@
        php_info_print_table_start();
        php_info_print_table_header(2, "Tidy support", "enabled");
        php_info_print_table_row(2, "libTidy Release", (char 
*)tidyReleaseDate());
-       php_info_print_table_row(2, "Extension Version", 
PHP_TIDY_MODULE_VERSION " ($Id: tidy.c,v 1.66.2.5 2006/01/01 12:50:16 sniper 
Exp $)");
+       php_info_print_table_row(2, "Extension Version", 
PHP_TIDY_MODULE_VERSION " ($Id: tidy.c,v 1.66.2.6 2006/03/29 14:28:42 tony2001 
Exp $)");
        php_info_print_table_end();
 
        DISPLAY_INI_ENTRIES();
http://cvs.php.net/viewcvs.cgi/php-src/ext/xmlreader/php_xmlreader.c?r1=1.13.2.11&r2=1.13.2.12&diff_format=u
Index: php-src/ext/xmlreader/php_xmlreader.c
diff -u php-src/ext/xmlreader/php_xmlreader.c:1.13.2.11 
php-src/ext/xmlreader/php_xmlreader.c:1.13.2.12
--- php-src/ext/xmlreader/php_xmlreader.c:1.13.2.11     Fri Mar 17 10:15:58 2006
+++ php-src/ext/xmlreader/php_xmlreader.c       Wed Mar 29 14:28:43 2006
@@ -16,7 +16,7 @@
   +----------------------------------------------------------------------+
 */
 
-/* $Id: php_xmlreader.c,v 1.13.2.11 2006/03/17 10:15:58 tony2001 Exp $ */
+/* $Id: php_xmlreader.c,v 1.13.2.12 2006/03/29 14:28:43 tony2001 Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -377,8 +377,7 @@
 {
        xmlreader_object *intern = (xmlreader_object *)object;
 
-       zend_hash_destroy(intern->std.properties);
-       FREE_HASHTABLE(intern->std.properties);
+       zend_object_std_dtor(&intern->std TSRMLS_CC);
        
        xmlreader_free_resources(intern);
 
@@ -394,15 +393,12 @@
        zval *tmp;
 
        intern = emalloc(sizeof(xmlreader_object));
-       intern->std.ce = class_type;
-       intern->std.guards = NULL;
        intern->ptr = NULL;
        intern->input = NULL;
        intern->schema = NULL;
        intern->prop_handler = &xmlreader_prop_handlers;
 
-       ALLOC_HASHTABLE(intern->std.properties);
-       zend_hash_init(intern->std.properties, 0, NULL, ZVAL_PTR_DTOR, 0);
+       zend_object_std_init(&intern->std, class_type TSRMLS_CC);
        zend_hash_copy(intern->std.properties, &class_type->default_properties, 
(copy_ctor_func_t) zval_add_ref, (void *) &tmp, sizeof(zval *));
        retval.handle = zend_objects_store_put(intern, 
(zend_objects_store_dtor_t)zend_objects_destroy_object, 
(zend_objects_free_object_storage_t) xmlreader_objects_free_storage, 
xmlreader_objects_clone TSRMLS_CC);
        intern->handle = retval.handle;
http://cvs.php.net/viewcvs.cgi/php-src/ext/xmlwriter/php_xmlwriter.c?r1=1.20.2.10&r2=1.20.2.11&diff_format=u
Index: php-src/ext/xmlwriter/php_xmlwriter.c
diff -u php-src/ext/xmlwriter/php_xmlwriter.c:1.20.2.10 
php-src/ext/xmlwriter/php_xmlwriter.c:1.20.2.11
--- php-src/ext/xmlwriter/php_xmlwriter.c:1.20.2.10     Mon Feb  6 11:28:41 2006
+++ php-src/ext/xmlwriter/php_xmlwriter.c       Wed Mar 29 14:28:43 2006
@@ -17,7 +17,7 @@
   +----------------------------------------------------------------------+
 */
 
-/* $Id: php_xmlwriter.c,v 1.20.2.10 2006/02/06 11:28:41 tony2001 Exp $ */
+/* $Id: php_xmlwriter.c,v 1.20.2.11 2006/03/29 14:28:43 tony2001 Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -77,11 +77,8 @@
                xmlwriter_free_resource_ptr(intern->xmlwriter_ptr TSRMLS_CC);
        }
        intern->xmlwriter_ptr = NULL;
-       if (intern->zo.properties) {
-               zend_hash_destroy(intern->zo.properties);
-               FREE_HASHTABLE(intern->zo.properties);
-       }
-
+       zend_object_std_dtor(&intern->zo TSRMLS_CC);
+       
        efree(intern);
 }
 /* }}} */
@@ -96,11 +93,9 @@
 
        intern = emalloc(sizeof(ze_xmlwriter_object));
        memset(&intern->zo, 0, sizeof(zend_object));
-       intern->zo.ce = class_type;
        intern->xmlwriter_ptr = NULL;
        
-       ALLOC_HASHTABLE(intern->zo.properties);
-       zend_hash_init(intern->zo.properties, 0, NULL, ZVAL_PTR_DTOR, 0);
+       zend_object_std_init(&intern->zo, class_type TSRMLS_CC);
        zend_hash_copy(intern->zo.properties, &class_type->default_properties, 
(copy_ctor_func_t) zval_add_ref,
                                        (void *) &tmp, sizeof(zval *));
 
http://cvs.php.net/viewcvs.cgi/php-src/ext/xsl/php_xsl.c?r1=1.32.2.5&r2=1.32.2.6&diff_format=u
Index: php-src/ext/xsl/php_xsl.c
diff -u php-src/ext/xsl/php_xsl.c:1.32.2.5 php-src/ext/xsl/php_xsl.c:1.32.2.6
--- php-src/ext/xsl/php_xsl.c:1.32.2.5  Sun Jan  1 12:50:17 2006
+++ php-src/ext/xsl/php_xsl.c   Wed Mar 29 14:28:43 2006
@@ -16,7 +16,7 @@
   +----------------------------------------------------------------------+
 */
 
-/* $Id: php_xsl.c,v 1.32.2.5 2006/01/01 12:50:17 sniper Exp $ */
+/* $Id: php_xsl.c,v 1.32.2.6 2006/03/29 14:28:43 tony2001 Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -80,8 +80,7 @@
 {
        xsl_object *intern = (xsl_object *)object;
 
-       zend_hash_destroy(intern->std.properties);
-       FREE_HASHTABLE(intern->std.properties);
+       zend_object_std_dtor(&intern->std TSRMLS_CC);
 
        zend_hash_destroy(intern->parameter);
        FREE_HASHTABLE(intern->parameter);
@@ -119,8 +118,6 @@
        zval *tmp;
 
        intern = emalloc(sizeof(xsl_object));
-       intern->std.ce = class_type;
-       intern->std.guards = NULL;
        intern->ptr = NULL;
        intern->prop_handler = NULL;
        intern->parameter = NULL;
@@ -130,8 +127,7 @@
        intern->node_list = NULL;
        intern->doc = NULL;
 
-       ALLOC_HASHTABLE(intern->std.properties);
-       zend_hash_init(intern->std.properties, 0, NULL, ZVAL_PTR_DTOR, 0);
+       zend_object_std_init(&intern->std, class_type TSRMLS_CC);
        zend_hash_copy(intern->std.properties, &class_type->default_properties, 
(copy_ctor_func_t) zval_add_ref, (void *) &tmp, sizeof(zval *));
        ALLOC_HASHTABLE(intern->parameter);
        zend_hash_init(intern->parameter, 0, NULL, ZVAL_PTR_DTOR, 0);

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to