From fa7c418b79b99b2cc16f53ba3bd11b9c7aabc74c Mon Sep 17 00:00:00 2001 From: Zeev Suraski Date: Wed, 26 Apr 2000 22:10:06 +0000 Subject: Fix - forgot to split away if refcount>1 --- Zend/zend_execute_API.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'Zend/zend_execute_API.c') 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; -- cgit v1.2.1