]> granicus.if.org Git - php/commitdiff
Fixed bug #48004 (Error handler prevents creation of default object)
authorDmitry Stogov <dmitry@php.net>
Tue, 21 Apr 2009 09:40:33 +0000 (09:40 +0000)
committerDmitry Stogov <dmitry@php.net>
Tue, 21 Apr 2009 09:40:33 +0000 (09:40 +0000)
Zend/zend_execute.c

index 2590656648f88cae3abcd18dabf53e5a51810d84..f1f1cea6c8c0ce535c70603c542a8f80caf1e5a6 100644 (file)
@@ -578,9 +578,9 @@ static inline void zend_assign_to_object(znode *result, zval **object_ptr, zval
                    (Z_TYPE_P(object) == IS_STRING && Z_STRLEN_P(object) == 0) ||
                    (Z_TYPE_P(object) == IS_UNICODE && Z_USTRLEN_P(object) == 0)) {
                        SEPARATE_ZVAL_IF_NOT_REF(object_ptr);
-                       zval_dtor(object);
+                       zval_dtor(*object_ptr);
+                       object_init(*object_ptr);
                        object = *object_ptr;
-                       object_init(object);
                        zend_error(E_STRICT, "Creating default object from empty value");
                } else {
                        zend_error(E_WARNING, "Attempt to assign property of non-object");
@@ -593,8 +593,6 @@ static inline void zend_assign_to_object(znode *result, zval **object_ptr, zval
                }
        }
 
-       /* here we are sure we are dealing with an object */
-
        /* separate our value if necessary */
        if (value_op->op_type == IS_TMP_VAR) {
                zval *orig_value = value;