summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZeev Suraski <zeev@php.net>2000-04-26 22:10:06 +0000
committerZeev Suraski <zeev@php.net>2000-04-26 22:10:06 +0000
commitfa7c418b79b99b2cc16f53ba3bd11b9c7aabc74c (patch)
tree6f8f5522f6ec1c83fadb701f16572e1714fa3e71
parent68e54e9922df701d10990fd6b86911ef29fe0528 (diff)
downloadphp-git-fa7c418b79b99b2cc16f53ba3bd11b9c7aabc74c.tar.gz
Fix - forgot to split away if refcount>1
-rw-r--r--Zend/zend_execute_API.c9
-rw-r--r--Zend/zend_variables.c1
2 files changed, 9 insertions, 1 deletions
diff --git a/Zend/zend_execute_API.c b/Zend/zend_execute_API.c
index cf8a98f55b..8b30319425 100644
--- a/Zend/zend_execute_API.c
+++ b/Zend/zend_execute_API.c
@@ -292,7 +292,12 @@ ZEND_API int zval_update_constant(zval **pp)
if (p->type == IS_CONSTANT) {
zval c;
- int refcount = p->refcount;
+ int refcount;
+
+ SEPARATE_ZVAL(pp);
+ p = *pp;
+
+ refcount = p->refcount;
if (!zend_get_constant(p->value.str.val, p->value.str.len, &c)) {
zend_error(E_NOTICE, "Use of undefined constant %s - assumed '%s'",
@@ -306,6 +311,8 @@ ZEND_API int zval_update_constant(zval **pp)
INIT_PZVAL(p);
p->refcount = refcount;
} else if (p->type == IS_ARRAY) {
+ SEPARATE_ZVAL(pp);
+ p = *pp;
zend_hash_apply(p->value.ht, (int (*)(void *)) zval_update_constant);
}
return 0;
diff --git a/Zend/zend_variables.c b/Zend/zend_variables.c
index e57ad0de33..2fa87df02d 100644
--- a/Zend/zend_variables.c
+++ b/Zend/zend_variables.c
@@ -115,6 +115,7 @@ ZEND_API int _zval_copy_ctor(zval *zvalue ZEND_FILE_LINE_DC)
case IS_LONG:
case IS_NULL:
break;
+ case IS_CONSTANT:
case IS_STRING:
if (zvalue->value.str.val) {
if (zvalue->value.str.len==0) {