From: Jani Taskinen Date: Thu, 19 Jul 2007 15:29:30 +0000 (+0000) Subject: MFH: Use SEPARATE_ZVAL_IF_NOT_REF for cleaner code. X-Git-Tag: php-5.2.4RC1~112 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=fb7efdab866fdafd8d619f671cea301646777d2d;p=php MFH: Use SEPARATE_ZVAL_IF_NOT_REF for cleaner code. --- diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c index c69dcd72b6..74e9e96587 100644 --- a/Zend/zend_execute.c +++ b/Zend/zend_execute.c @@ -430,17 +430,16 @@ static void zend_assign_to_variable_reference(zval **variable_ptr_ptr, zval **va } } +/* this should modify object only if it's empty */ static inline void make_real_object(zval **object_ptr TSRMLS_DC) { -/* this should modify object only if it's empty */ if (Z_TYPE_PP(object_ptr) == IS_NULL - || (Z_TYPE_PP(object_ptr) == IS_BOOL && Z_LVAL_PP(object_ptr)==0) - || (Z_TYPE_PP(object_ptr) == IS_STRING && Z_STRLEN_PP(object_ptr) == 0)) { - - if (!PZVAL_IS_REF(*object_ptr)) { - SEPARATE_ZVAL(object_ptr); - } + || (Z_TYPE_PP(object_ptr) == IS_BOOL && Z_LVAL_PP(object_ptr) == 0) + || (Z_TYPE_PP(object_ptr) == IS_STRING && Z_STRLEN_PP(object_ptr) == 0) + ) { zend_error(E_STRICT, "Creating default object from empty value"); + + SEPARATE_ZVAL_IF_NOT_REF(object_ptr); zval_dtor(*object_ptr); object_init(*object_ptr); }