cvs: Zend / zend_compile.c
| From: | Andrei Zmievski | Date: | Thu, 14 Feb 2002 03:55:21 +0000 |
| Subject: | cvs: Zend / zend_compile.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-9370@lists.php.net to get a copy of this message | ||
andrei Wed Feb 13 22:55:21 2002 EDT
Modified files:
/Zend zend_compile.c
Log:
Fix the bug where the declared properties without init values were not
entered into the table.
Index: Zend/zend_compile.c
diff -u Zend/zend_compile.c:1.224 Zend/zend_compile.c:1.225
--- Zend/zend_compile.c:1.224 Sun Jan 6 10:21:09 2002
+++ Zend/zend_compile.c Wed Feb 13 22:55:20 2002
@@ -1642,14 +1642,18 @@
void zend_do_declare_property(znode *var_name, znode *value TSRMLS_DC)
{
- if (value) {
- zval *property;
+ zval *property;
- ALLOC_ZVAL(property);
+ ALLOC_ZVAL(property);
+ if (value) {
*property = value->u.constant;
- zend_hash_update(&CG(active_class_entry)->default_properties,
var_name->u.constant.value.str.val, var_name->u.constant.value.str.len+1, &property,
sizeof(zval *), NULL);
+ } else {
+ INIT_PZVAL(property);
+ property->type = IS_NULL;
}
+
+ zend_hash_update(&CG(active_class_entry)->default_properties,
var_name->u.constant.value.str.val, var_name->u.constant.value.str.len+1, &property,
sizeof(zval *), NULL);
FREE_PNODE(var_name);
}