summaryrefslogtreecommitdiff
path: root/Zend/zend_execute.c
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@php.net>2009-04-21 08:12:07 +0000
committerDmitry Stogov <dmitry@php.net>2009-04-21 08:12:07 +0000
commitfb3c73daefc1be08fe2b8cd9f6ff33b322a69928 (patch)
tree4c3960a57c08550974dd9baf1c0ddd0ea0f94988 /Zend/zend_execute.c
parent788766bfa590ae4bf2543bd131adef522e47e2e4 (diff)
downloadphp-git-fb3c73daefc1be08fe2b8cd9f6ff33b322a69928.tar.gz
Fixed bug #48004 (Error handler prevents creation of default object)
Diffstat (limited to 'Zend/zend_execute.c')
-rw-r--r--Zend/zend_execute.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c
index 5fba77a475..fb0e8fcd0b 100644
--- a/Zend/zend_execute.c
+++ b/Zend/zend_execute.c
@@ -518,13 +518,13 @@ static inline int zend_verify_arg_type(zend_function *zf, zend_uint arg_num, zva
static inline void zend_assign_to_object(znode *result, zval **object_ptr, zval *property_name, znode *value_op, const temp_variable *Ts, int opcode TSRMLS_DC)
{
- zval *object;
+ zval *object = *object_ptr;
zend_free_op free_value;
zval *value = get_zval_ptr(value_op, Ts, &free_value, BP_VAR_R);
zval **retval = &T(result->u.var).var.ptr;
- if (Z_TYPE_P(*object_ptr) != IS_OBJECT) {
- if (*object_ptr == EG(error_zval_ptr)) {
+ if (Z_TYPE_P(object) != IS_OBJECT) {
+ if (object == EG(error_zval_ptr)) {
if (!RETURN_VALUE_UNUSED(result)) {
*retval = EG(uninitialized_zval_ptr);
PZVAL_LOCK(*retval);
@@ -532,13 +532,14 @@ static inline void zend_assign_to_object(znode *result, zval **object_ptr, zval
FREE_OP(free_value);
return;
}
- 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)) {
- zend_error(E_STRICT, "Creating default object from empty value");
+ if (Z_TYPE_P(object) == IS_NULL ||
+ (Z_TYPE_P(object) == IS_BOOL && Z_LVAL_P(object) == 0) ||
+ (Z_TYPE_P(object) == IS_STRING && Z_STRLEN_P(object) == 0)) {
SEPARATE_ZVAL_IF_NOT_REF(object_ptr);
- zval_dtor(*object_ptr);
- object_init(*object_ptr);
+ zval_dtor(object);
+ 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");
if (!RETURN_VALUE_UNUSED(result)) {
@@ -551,7 +552,6 @@ static inline void zend_assign_to_object(znode *result, zval **object_ptr, zval
}
/* here we are sure we are dealing with an object */
- object = *object_ptr;
/* separate our value if necessary */
if (value_op->op_type == IS_TMP_VAR) {