diff options
| author | Jani Taskinen <jani@php.net> | 2007-07-19 15:29:30 +0000 |
|---|---|---|
| committer | Jani Taskinen <jani@php.net> | 2007-07-19 15:29:30 +0000 |
| commit | fb7efdab866fdafd8d619f671cea301646777d2d (patch) | |
| tree | e1b560e2c6f96d91d98bc476a3917b18fb2ebae5 /Zend/zend_execute.c | |
| parent | a091268eef900a5361426c6e51dc85a96c569a58 (diff) | |
| download | php-git-fb7efdab866fdafd8d619f671cea301646777d2d.tar.gz | |
MFH: Use SEPARATE_ZVAL_IF_NOT_REF for cleaner code.
Diffstat (limited to 'Zend/zend_execute.c')
| -rw-r--r-- | Zend/zend_execute.c | 13 |
1 files changed, 6 insertions, 7 deletions
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); } |
