]> granicus.if.org Git - php/commitdiff
The macro REPLACE_ZVAL_VALUE cannot be used since we only have zval *
authorMarcus Boerger <helly@php.net>
Thu, 27 Nov 2003 19:08:28 +0000 (19:08 +0000)
committerMarcus Boerger <helly@php.net>
Thu, 27 Nov 2003 19:08:28 +0000 (19:08 +0000)
writeobj. to allow it the api needs to be changed to zval **writeobj.

Zend/zend_object_handlers.c

index 35c87eb22553f765485ef95de3ce18f44173f570..6e3b466c99a9ff1ad0f70b653f57d9ca019ae690 100644 (file)
@@ -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;
                }