From: Marcus Boerger Date: Thu, 27 Nov 2003 19:08:28 +0000 (+0000) Subject: The macro REPLACE_ZVAL_VALUE cannot be used since we only have zval * X-Git-Tag: php-5.0.0b3RC1~568 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=87577dd8810e033678f44ef89236d9e8637263a7;p=php The macro REPLACE_ZVAL_VALUE cannot be used since we only have zval * writeobj. to allow it the api needs to be changed to zval **writeobj. --- diff --git a/Zend/zend_object_handlers.c b/Zend/zend_object_handlers.c index 35c87eb225..6e3b466c99 100644 --- a/Zend/zend_object_handlers.c +++ b/Zend/zend_object_handlers.c @@ -885,6 +885,7 @@ int zend_std_object_get_class_name(zval *object, char **class_name, zend_uint *c int zend_std_cast_object(zval *readobj, zval *writeobj, int type, int should_free TSRMLS_DC) { zval fname, *retval; + int is_ref, refcount; switch (type) { case IS_STRING: @@ -898,7 +899,13 @@ int zend_std_cast_object(zval *readobj, zval *writeobj, int type, int should_fre MAKE_STD_ZVAL(retval); ZVAL_STRINGL(retval, empty_string, 0, 0); } - REPLACE_ZVAL_VALUE(&writeobj, retval, 1); + zval_dtor(writeobj); + is_ref = writeobj->is_ref; + refcount = writeobj->refcount; + *writeobj = *retval; + zval_copy_ctor(writeobj); + writeobj->is_ref = is_ref; + writeobj->refcount = refcount; zval_ptr_dtor(&retval); return SUCCESS; }