cvs: ZendEngine2 / zend_execute_API.c
| From: | Wez Furlong | Date: | Mon, 09 Jun 2003 17:02:32 +0000 |
| Subject: | cvs: ZendEngine2 / zend_execute_API.c | ||
| Groups: | php.zend-engine.cvs | ||
| Request: | Send a blank email to php-zend-engine-cvs+get-1362@lists.php.net to get a copy of this message | ||
wez Mon Jun 9 13:02:32 2003 EDT
Modified files:
/ZendEngine2 zend_execute_API.c
Log:
Fix for Bug #23951
Index: ZendEngine2/zend_execute_API.c
diff -u ZendEngine2/zend_execute_API.c:1.207 ZendEngine2/zend_execute_API.c:1.208
--- ZendEngine2/zend_execute_API.c:1.207 Mon Jun 9 06:55:37 2003
+++ ZendEngine2/zend_execute_API.c Mon Jun 9 13:02:32 2003
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend_execute_API.c,v 1.207 2003/06/09 10:55:37 stas Exp $ */
+/* $Id: zend_execute_API.c,v 1.208 2003/06/09 17:02:32 wez Exp $ */
#include <stdio.h>
#include <signal.h>
@@ -439,7 +439,7 @@
INIT_PZVAL(p);
p->refcount = refcount;
} else if (p->type == IS_CONSTANT_ARRAY) {
- zval **element;
+ zval **element, *new_val;
char *str_index;
uint str_index_len;
ulong num_index;
@@ -474,14 +474,21 @@
continue;
}
+ ALLOC_ZVAL(new_val);
+ *new_val = **element;
+ zval_copy_ctor(new_val);
+ new_val->refcount = 1;
+ new_val->is_ref = 0;
+
+ /* preserve this bit for inheritance */
+ Z_TYPE_PP(element) |= IS_CONSTANT_INDEX;
+
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);
- (*element)->refcount++;
+ zend_hash_update(p->value.ht, const_value.value.str.val, const_value.value.str.len+1,
&new_val, sizeof(zval *), NULL);
break;
case IS_LONG:
- zend_hash_index_update(p->value.ht, const_value.value.lval, element, sizeof(zval *), NULL);
- (*element)->refcount++;
+ zend_hash_index_update(p->value.ht, const_value.value.lval, &new_val, sizeof(zval *),
NULL);
break;
}
zend_hash_del(p->value.ht, str_index, str_index_len);