cvs: Zend / zend_execute_API.c
| From: | Stanislav Malyshev | Date: | Mon, 09 Sep 2002 15:10:36 +0000 |
| Subject: | cvs: Zend / zend_execute_API.c | ||
| Groups: | php.zend-engine.cvs | ||
| Request: | Send a blank email to php-zend-engine-cvs+get-412@lists.php.net to get a copy of this message | ||
stas Mon Sep 9 11:10:36 2002 EDT
Modified files:
/Zend zend_execute_API.c
Log:
fix bug #18668 - arrays with constant indexes
Index: Zend/zend_execute_API.c
diff -u Zend/zend_execute_API.c:1.148 Zend/zend_execute_API.c:1.149
--- Zend/zend_execute_API.c:1.148 Mon Sep 9 10:35:47 2002
+++ Zend/zend_execute_API.c Mon Sep 9 11:10:36 2002
@@ -350,6 +350,16 @@
zend_hash_move_forward(p->value.ht);
continue;
}
+
+ if(const_value.type == IS_STRING &&
+ const_value.value.str.len == str_index_len-1 &&
+ !strncmp(const_value.value.str.val, str_index, str_index_len)) {
+ /* constant value is the same as its name */
+ zval_dtor(&const_value);
+ zend_hash_move_forward(p->value.ht);
+ continue;
+ }
+
switch (const_value.type) {
case IS_STRING:
zend_hash_update(p->value.ht, const_value.value.str.val, const_value.value.str.len+1,
element, sizeof(zval *), NULL);
@@ -361,6 +371,7 @@
break;
}
zend_hash_del(p->value.ht, str_index, str_index_len);
+ zval_dtor(&const_value);
}
zend_hash_apply_with_argument(p->value.ht, (apply_func_arg_t) zval_update_constant, (void *) 1
TSRMLS_CC);
}