cvs: ZendEngine2 / zend_compile.c
| From: | Andi Gutmans | Date: | Thu, 13 Nov 2003 06:40:34 +0000 |
| Subject: | cvs: ZendEngine2 / zend_compile.c | ||
| Groups: | php.zend-engine.cvs | ||
| Request: | Send a blank email to php-zend-engine-cvs+get-1979@lists.php.net to get a copy of this message | ||
andi Thu Nov 13 01:40:34 2003 EDT
Modified files:
/ZendEngine2 zend_compile.c
Log:
- Make sure internal clasess are malloced
Index: ZendEngine2/zend_compile.c
diff -u ZendEngine2/zend_compile.c:1.492 ZendEngine2/zend_compile.c:1.493
--- ZendEngine2/zend_compile.c:1.492 Mon Nov 10 11:14:44 2003
+++ ZendEngine2/zend_compile.c Thu Nov 13 01:40:34 2003
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend_compile.c,v 1.492 2003/11/10 16:14:44 helly Exp $ */
+/* $Id: zend_compile.c,v 1.493 2003/11/13 06:40:34 andi Exp $ */
#include "zend_language_parser.h"
#include "zend.h"
@@ -3513,6 +3513,7 @@
void zend_initialize_class_data(zend_class_entry *ce, zend_bool nullify_handlers TSRMLS_DC)
{
zend_bool persistent_hashes = (ce->type == ZEND_INTERNAL_CLASS) ? 1 : 0;
+ dtor_func_t zval_ptr_dtor_func = ((persistent_hashes) ? ZVAL_INTERNAL_PTR_DTOR : ZVAL_PTR_DTOR);
ce->refcount = 1;
ce->constants_updated = 0;
@@ -3521,7 +3522,7 @@
ce->doc_comment = NULL;
ce->doc_comment_len = 0;
- zend_hash_init_ex(&ce->default_properties, 0, NULL, persistent_hashes ?
ZVAL_INTERNAL_PTR_DTOR : ZVAL_PTR_DTOR, persistent_hashes, 0);
+ zend_hash_init_ex(&ce->default_properties, 0, NULL, zval_ptr_dtor_func, persistent_hashes,
0);
zend_hash_init_ex(&ce->properties_info, 0, NULL, (dtor_func_t) (persistent_hashes ?
zend_destroy_property_info_internal : zend_destroy_property_info), persistent_hashes, 0);
if (persistent_hashes) {
@@ -3529,8 +3530,9 @@
} else {
ALLOC_HASHTABLE(ce->static_members);
}
- zend_hash_init_ex(ce->static_members, 0, NULL, ZVAL_PTR_DTOR, persistent_hashes, 0);
- zend_hash_init_ex(&ce->constants_table, 0, NULL, ZVAL_PTR_DTOR, persistent_hashes, 0);
+
+ zend_hash_init_ex(ce->static_members, 0, NULL, zval_ptr_dtor_func, persistent_hashes, 0);
+ zend_hash_init_ex(&ce->constants_table, 0, NULL, zval_ptr_dtor_func, persistent_hashes, 0);
zend_hash_init_ex(&ce->function_table, 0, NULL, ZEND_FUNCTION_DTOR, persistent_hashes, 0);
if (nullify_handlers) {