Browse Source

Fix - forgot to split away if refcount>1

PHP-4.0.5
Zeev Suraski 26 years ago
parent
commit
fa7c418b79
  1. 9
      Zend/zend_execute_API.c
  2. 1
      Zend/zend_variables.c

9
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;

1
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) {

Loading…
Cancel
Save