]> granicus.if.org Git - php/commitdiff
Correct fix
authorZeev Suraski <zeev@php.net>
Sat, 29 May 1999 12:00:32 +0000 (12:00 +0000)
committerZeev Suraski <zeev@php.net>
Sat, 29 May 1999 12:00:32 +0000 (12:00 +0000)
Zend/zend_execute.c

index 2eb15542bda50f7a5bf5cb3ceb6f9626e8618e35..f678d72d4b7f8477b373c85926ecd469c1c70e67 100644 (file)
@@ -272,10 +272,7 @@ static inline void zend_assign_to_variable(znode *result, znode *op1, zval *valu
                        }
                }
        } else {
-               if (--variable_ptr->refcount==0) {
-                       zval_dtor(variable_ptr);
-               }
-               variable_ptr = *variable_ptr_ptr;
+               variable_ptr->refcount--;
                if (variable_ptr->refcount==0) {
                        switch (type) {
                                case IS_VAR:
@@ -283,6 +280,7 @@ static inline void zend_assign_to_variable(znode *result, znode *op1, zval *valu
                                        if (variable_ptr==value) {
                                                variable_ptr->refcount++;
                                        } else if (value->is_ref) {
+                                               zendi_zval_dtor(*variable_ptr);
                                                *variable_ptr = *value;
                                                zval_copy_ctor(variable_ptr);
                                                variable_ptr->refcount=1;