cvs: ZendEngine2 / zend_API.c zend_API.h zend_compile.c zend_default_classes.c

From: Date: Wed, 03 Sep 2003 18:01:22 +0000
Subject: cvs: ZendEngine2 / zend_API.c zend_API.h zend_compile.c zend_default_classes.c
Groups: php.zend-engine.cvs 
Request: Send a blank email to php-zend-engine-cvs+get-1803@lists.php.net to get a copy of this message
helly Wed Sep 3 14:01:22 2003 EDT Modified files: /ZendEngine2 zend_API.c zend_API.h zend_compile.c zend_default_classes.c Log: Fix handling of static properties initialized to arrays

Index: ZendEngine2/zend_API.c diff -u ZendEngine2/zend_API.c:1.215 ZendEngine2/zend_API.c:1.216 --- ZendEngine2/zend_API.c:1.215 Wed Sep 3 12:13:40 2003 +++ ZendEngine2/zend_API.c Wed Sep 3 14:01:22 2003 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_API.c,v 1.215 2003/09/03 16:13:40 helly Exp $ */ +/* $Id: zend_API.c,v 1.216 2003/09/03 18:01:22 helly Exp $ */ #include "zend.h" #include "zend_execute.h" @@ -1659,7 +1659,7 @@ } -ZEND_API int zend_declare_property(zend_class_entry *ce, char *name, int name_length, zval *property, int access_type) +ZEND_API int zend_declare_property(zend_class_entry *ce, char *name, int name_length, zval *property, int access_type TSRMLS_DC) { zend_property_info property_info; HashTable *target_symbol_table; @@ -1683,6 +1683,8 @@ default: break; } + } else { + zval_update_constant(&property, (void *) 1 TSRMLS_CC); } switch (access_type & ZEND_ACC_PPP_MASK) { case ZEND_ACC_PRIVATE: { @@ -1727,7 +1729,7 @@ return SUCCESS; } -ZEND_API int zend_declare_property_null(zend_class_entry *ce, char *name, int name_length, int access_type) +ZEND_API int zend_declare_property_null(zend_class_entry *ce, char *name, int name_length, int access_type TSRMLS_DC) { zval *property; @@ -1737,10 +1739,10 @@ ALLOC_ZVAL(property); } INIT_ZVAL(*property); - return zend_declare_property(ce, name, name_length, property, access_type); + return zend_declare_property(ce, name, name_length, property, access_type TSRMLS_CC); } -ZEND_API int zend_declare_property_long(zend_class_entry *ce, char *name, int name_length, long value, int access_type) +ZEND_API int zend_declare_property_long(zend_class_entry *ce, char *name, int name_length, long value, int access_type TSRMLS_DC) { zval *property; @@ -1751,10 +1753,10 @@ } INIT_PZVAL(property); ZVAL_LONG(property, value); - return zend_declare_property(ce, name, name_length, property, access_type); + return zend_declare_property(ce, name, name_length, property, access_type TSRMLS_CC); } -ZEND_API int zend_declare_property_string(zend_class_entry *ce, char *name, int name_length, char *value, int access_type) +ZEND_API int zend_declare_property_string(zend_class_entry *ce, char *name, int name_length, char *value, int access_type TSRMLS_DC) { zval *property; int len = strlen(value); @@ -1767,7 +1769,7 @@ ZVAL_STRINGL(property, value, len, 1); } INIT_PZVAL(property); - return zend_declare_property(ce, name, name_length, property, access_type); + return zend_declare_property(ce, name, name_length, property, access_type TSRMLS_CC); } ZEND_API void zend_update_property(zend_class_entry *scope, zval *object, char *name, int name_length, zval *value TSRMLS_DC) Index: ZendEngine2/zend_API.h diff -u ZendEngine2/zend_API.h:1.160 ZendEngine2/zend_API.h:1.161 --- ZendEngine2/zend_API.h:1.160 Fri Aug 29 19:27:22 2003 +++ ZendEngine2/zend_API.h Wed Sep 3 14:01:22 2003 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_API.h,v 1.160 2003/08/29 23:27:22 helly Exp $ */ +/* $Id: zend_API.h,v 1.161 2003/09/03 18:01:22 helly Exp $ */ #ifndef ZEND_API_H #define ZEND_API_H @@ -165,10 +165,10 @@ ZEND_API void zend_wrong_param_count(TSRMLS_D); ZEND_API zend_bool zend_is_callable(zval *callable, zend_bool syntax_only, char **callable_name); ZEND_API char *zend_get_module_version(char *module_name); -ZEND_API int zend_declare_property(zend_class_entry *ce, char *name, int name_length, zval *property, int access_type); -ZEND_API int zend_declare_property_null(zend_class_entry *ce, char *name, int name_length, int access_type); -ZEND_API int zend_declare_property_long(zend_class_entry *ce, char *name, int name_length, long value, int access_type); -ZEND_API int zend_declare_property_string(zend_class_entry *ce, char *name, int name_length, char *value, int access_type); +ZEND_API int zend_declare_property(zend_class_entry *ce, char *name, int name_length, zval *property, int access_type TSRMLS_DC); +ZEND_API int zend_declare_property_null(zend_class_entry *ce, char *name, int name_length, int access_type TSRMLS_DC); +ZEND_API int zend_declare_property_long(zend_class_entry *ce, char *name, int name_length, long value, int access_type TSRMLS_DC); +ZEND_API int zend_declare_property_string(zend_class_entry *ce, char *name, int name_length, char *value, int access_type TSRMLS_DC); ZEND_API void zend_update_property(zend_class_entry *scope, zval *object, char *name, int name_length, zval *value TSRMLS_DC); ZEND_API void zend_update_property_null(zend_class_entry *scope, zval *object, char *name, int name_length TSRMLS_DC); @@ -473,7 +473,7 @@ { \ char *_name = (name); \ int namelen = strlen(_name); \ - zend_declare_property(class_ptr, _name, namelen, value, mask); \ + zend_declare_property(class_ptr, _name, namelen, value, mask TSRMLS_CC); \ } #define HASH_OF(p) ((p)->type==IS_ARRAY ? (p)->value.ht : (((p)->type==IS_OBJECT ? Z_OBJ_HT_P(p)->get_properties((p) TSRMLS_CC) : NULL))) Index: ZendEngine2/zend_compile.c diff -u ZendEngine2/zend_compile.c:1.476 ZendEngine2/zend_compile.c:1.477 --- ZendEngine2/zend_compile.c:1.476 Wed Sep 3 12:34:35 2003 +++ ZendEngine2/zend_compile.c Wed Sep 3 14:01:22 2003 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_compile.c,v 1.476 2003/09/03 16:34:35 helly Exp $ */ +/* $Id: zend_compile.c,v 1.477 2003/09/03 18:01:22 helly Exp $ */ #include "zend_language_parser.h" #include "zend.h" @@ -2407,7 +2407,7 @@ property->type = IS_NULL; } - zend_declare_property(CG(active_class_entry), var_name->u.constant.value.str.val, var_name->u.constant.value.str.len, property, access_type); + zend_declare_property(CG(active_class_entry), var_name->u.constant.value.str.val, var_name->u.constant.value.str.len, property, access_type TSRMLS_CC); efree(var_name->u.constant.value.str.val); } Index: ZendEngine2/zend_default_classes.c diff -u ZendEngine2/zend_default_classes.c:1.34 ZendEngine2/zend_default_classes.c:1.35 --- ZendEngine2/zend_default_classes.c:1.34 Mon Sep 1 17:40:58 2003 +++ ZendEngine2/zend_default_classes.c Wed Sep 3 14:01:22 2003 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_default_classes.c,v 1.34 2003/09/01 21:40:58 helly Exp $ */ +/* $Id: zend_default_classes.c,v 1.35 2003/09/03 18:01:22 helly Exp $ */ #include "zend.h" #include "zend_API.h" @@ -364,12 +364,12 @@ default_exception_ptr = zend_register_internal_class(&ce TSRMLS_CC); default_exception_ptr->create_object = zend_default_exception_new; - zend_declare_property_string(default_exception_ptr, "message", sizeof("message")-1, "Unknown exception", ZEND_ACC_PROTECTED); - zend_declare_property_string(default_exception_ptr, "string", sizeof("string")-1, "", ZEND_ACC_PRIVATE); - zend_declare_property_long(default_exception_ptr, "code", sizeof("code")-1, 0, ZEND_ACC_PROTECTED); - zend_declare_property_null(default_exception_ptr, "file", sizeof("file")-1, ZEND_ACC_PROTECTED); - zend_declare_property_null(default_exception_ptr, "line", sizeof("line")-1, ZEND_ACC_PROTECTED); - zend_declare_property_null(default_exception_ptr, "trace", sizeof("trace")-1, ZEND_ACC_PROTECTED); + zend_declare_property_string(default_exception_ptr, "message", sizeof("message")-1, "Unknown exception", ZEND_ACC_PROTECTED TSRMLS_CC); + zend_declare_property_string(default_exception_ptr, "string", sizeof("string")-1, "", ZEND_ACC_PRIVATE TSRMLS_CC); + zend_declare_property_long(default_exception_ptr, "code", sizeof("code")-1, 0, ZEND_ACC_PROTECTED TSRMLS_CC); + zend_declare_property_null(default_exception_ptr, "file", sizeof("file")-1, ZEND_ACC_PROTECTED TSRMLS_CC); + zend_declare_property_null(default_exception_ptr, "line", sizeof("line")-1, ZEND_ACC_PROTECTED TSRMLS_CC); + zend_declare_property_null(default_exception_ptr, "trace", sizeof("trace")-1, ZEND_ACC_PROTECTED TSRMLS_CC); } ZEND_API zend_class_entry *zend_exception_get_default(void)
« previous php.zend-engine.cvs (#1803) next »