cvs: ZendEngine2 / zend.c zend_API.c zend_compile.c
| From: | Andrei Zmievski | Date: | Thu, 03 Apr 2003 14:44:42 +0000 |
| Subject: | cvs: ZendEngine2 / zend.c zend_API.c zend_compile.c | ||
| Groups: | php.zend-engine.cvs | ||
| Request: | Send a blank email to php-zend-engine-cvs+get-1111@lists.php.net to get a copy of this message | ||
andrei Thu Apr 3 09:44:42 2003 EDT
Modified files:
/ZendEngine2 zend.c zend_API.c zend_compile.c
Log:
Initialize all relevant zend_class_entry fields to avoid accidental
crashes.
Index: ZendEngine2/zend.c
diff -u ZendEngine2/zend.c:1.221 ZendEngine2/zend.c:1.222
--- ZendEngine2/zend.c:1.221 Mon Mar 31 02:34:05 2003
+++ ZendEngine2/zend.c Thu Apr 3 09:44:41 2003
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend.c,v 1.221 2003/03/31 07:34:05 stas Exp $ */
+/* $Id: zend.c,v 1.222 2003/04/03 14:44:41 andrei Exp $ */
#include "zend.h"
#include "zend_extensions.h"
@@ -377,7 +377,6 @@
zend_standard_class_def->type = ZEND_INTERNAL_CLASS;
zend_standard_class_def->name_length = sizeof("stdClass") - 1;
zend_standard_class_def->name = zend_strndup("stdClass",
zend_standard_class_def->name_length);
- zend_standard_class_def->parent = NULL;
zend_initialize_class_data(zend_standard_class_def, 1 TSRMLS_CC);
zend_hash_add(GLOBAL_CLASS_TABLE, "stdclass", sizeof("stdclass"),
&zend_standard_class_def, sizeof(zend_class_entry *), NULL);
Index: ZendEngine2/zend_API.c
diff -u ZendEngine2/zend_API.c:1.163 ZendEngine2/zend_API.c:1.164
--- ZendEngine2/zend_API.c:1.163 Wed Apr 2 15:27:44 2003
+++ ZendEngine2/zend_API.c Thu Apr 3 09:44:41 2003
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend_API.c,v 1.163 2003/04/02 20:27:44 andrei Exp $ */
+/* $Id: zend_API.c,v 1.164 2003/04/03 14:44:41 andrei Exp $ */
#include "zend.h"
#include "zend_execute.h"
@@ -1372,7 +1372,6 @@
*class_entry = *orig_class_entry;
class_entry->type = ZEND_INTERNAL_CLASS;
- class_entry->parent = NULL;
zend_initialize_class_data(class_entry, 0 TSRMLS_CC);
if (class_entry->builtin_functions) {
Index: ZendEngine2/zend_compile.c
diff -u ZendEngine2/zend_compile.c:1.407 ZendEngine2/zend_compile.c:1.408
--- ZendEngine2/zend_compile.c:1.407 Wed Apr 2 11:51:49 2003
+++ ZendEngine2/zend_compile.c Thu Apr 3 09:44:41 2003
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend_compile.c,v 1.407 2003/04/02 16:51:49 andrei Exp $ */
+/* $Id: zend_compile.c,v 1.408 2003/04/03 14:44:41 andrei Exp $ */
#include "zend_language_parser.h"
#include "zend.h"
@@ -2204,9 +2204,6 @@
new_class_entry->name = class_name->u.constant.value.str.val;
new_class_entry->name_length = class_name->u.constant.value.str.len;
- new_class_entry->parent = NULL;
- new_class_entry->num_interfaces = 0;
-
zend_initialize_class_data(new_class_entry, 1 TSRMLS_CC);
new_class_entry->filename = zend_get_compiled_filename(TSRMLS_C);
new_class_entry->line_start = zend_get_compiled_lineno(TSRMLS_C);
@@ -3354,6 +3351,8 @@
zend_hash_init_ex(&ns->constants_table, 10, NULL, ZVAL_PTR_DTOR, persistent_hashes, 0);
ns->parent = NULL;
+ ns->num_interfaces = 0;
+ ns->interfaces = NULL;
ns->ns = NULL;
ns->constructor = NULL;
ns->destructor = NULL;
@@ -3523,6 +3522,9 @@
ce->create_object = NULL;
}
+ ce->parent = NULL;
+ ce->num_interfaces = 0;
+ ce->interfaces = NULL;
ce->ns = CG(active_namespace);
}