summaryrefslogtreecommitdiff
path: root/Zend/zend_execute_API.c
diff options
context:
space:
mode:
authorZeev Suraski <zeev@php.net>2000-05-31 19:07:09 +0000
committerZeev Suraski <zeev@php.net>2000-05-31 19:07:09 +0000
commit13b67621cfb4ba5fc71668f353f8128346e88904 (patch)
tree7cc7c8b28e64f5d81a4f5d4d5dbf7408a2ee6483 /Zend/zend_execute_API.c
parent1e672d4528c8861575bd0a6f0ef0a5e60626ab21 (diff)
downloadphp-git-13b67621cfb4ba5fc71668f353f8128346e88904.tar.gz
Fix a bug in static initializers/default values/class member variables that contained
array values
Diffstat (limited to 'Zend/zend_execute_API.c')
-rw-r--r--Zend/zend_execute_API.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/Zend/zend_execute_API.c b/Zend/zend_execute_API.c
index f5916a1023..21ee9c40c0 100644
--- a/Zend/zend_execute_API.c
+++ b/Zend/zend_execute_API.c
@@ -286,9 +286,10 @@ ZEND_API int zend_is_true(zval *op)
}
-ZEND_API int zval_update_constant(zval **pp)
+ZEND_API int zval_update_constant(zval **pp, void *arg)
{
zval *p = *pp;
+ zend_bool inline_change = (zend_bool) arg;
if (p->type == IS_CONSTANT) {
zval c;
@@ -304,16 +305,22 @@ ZEND_API int zval_update_constant(zval **pp)
p->value.str.val,
p->value.str.val);
p->type = IS_STRING;
+ if (!inline_change) {
+ zval_copy_ctor(p);
+ }
} else {
- STR_FREE(p->value.str.val);
+ if (inline_change) {
+ STR_FREE(p->value.str.val);
+ }
*p = c;
}
INIT_PZVAL(p);
p->refcount = refcount;
- } else if (p->type == IS_ARRAY) {
+ } else if (p->type == IS_CONSTANT_ARRAY) {
SEPARATE_ZVAL(pp);
p = *pp;
- zend_hash_apply(p->value.ht, (int (*)(void *)) zval_update_constant);
+ p->type = IS_ARRAY;
+ zend_hash_apply_with_argument(p->value.ht, (int (*)(void *,void *)) zval_update_constant, (void *) 1);
}
return 0;
}