com php-src: fixed refcounting in "$a->magic_prop + = 2": Zend/zend_object_handlers.c Zend/zend _vm_def.h Zend/zend_vm_execute.h
| From: | Dmitry Stogov | Date: | Thu, 27 Feb 2014 19:18:37 +0000 |
| Subject: | com php-src: fixed refcounting in "$a->magic_prop + = 2": Zend/zend_object_handlers.c Zend/zend _vm_def.h Zend/zend_vm_execute.h | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-77862@lists.php.net to get a copy of this message | ||
Commit: e43d0d1717fb713ccce7b971f7b9114d2bd16507
Author: Dmitry Stogov <dmitry@zend.com> Thu, 27 Feb 2014 23:18:37 +0400
Parents: 5e4a97f36575c4f8562d541d4548461dd5483511
Branches: phpng
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=e43d0d1717fb713ccce7b971f7b9114d2bd16507
Log:
fixed refcounting in "$a->magic_prop += 2"
Changed paths:
M Zend/zend_object_handlers.c
M Zend/zend_vm_def.h
M Zend/zend_vm_execute.h
Diff:
diff --git a/Zend/zend_object_handlers.c b/Zend/zend_object_handlers.c
index b27ab71..62c8ad4 100644
--- a/Zend/zend_object_handlers.c
+++ b/Zend/zend_object_handlers.c
@@ -774,7 +774,7 @@ static zval *zend_std_get_property_ptr_ptr(zval *object, zval *member, int type,
}
if (!zobj->ce->__get ||
- (guard = zend_get_property_guard(zobj, property_info, member)) ||
+ (guard = zend_get_property_guard(zobj, property_info, member)) == NULL ||
(property_info && ((*guard) & IN_GET))) {
/* we don't have access controls - will just add it */
diff --git a/Zend/zend_vm_def.h b/Zend/zend_vm_def.h
index e8657ea..7fd005f 100644
--- a/Zend/zend_vm_def.h
+++ b/Zend/zend_vm_def.h
@@ -394,7 +394,7 @@ ZEND_VM_HELPER_EX(zend_binary_assign_op_obj_helper, VAR|UNUSED|CV, CONST|TMP|VAR
}
z = value;
}
- Z_ADDREF_P(z);
+ if (Z_REFCOUNTED_P(z)) Z_ADDREF_P(z);
SEPARATE_ZVAL_IF_NOT_REF(z);
binary_op(z, z, value TSRMLS_CC);
if (opline->extended_value == ZEND_ASSIGN_OBJ) {
diff --git a/Zend/zend_vm_execute.h b/Zend/zend_vm_execute.h
index 959d028..ed8a19f 100644
--- a/Zend/zend_vm_execute.h
+++ b/Zend/zend_vm_execute.h
@@ -13932,7 +13932,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_VAR_CONST(int
(*b
}
z = value;
}
- Z_ADDREF_P(z);
+ if (Z_REFCOUNTED_P(z)) Z_ADDREF_P(z);
SEPARATE_ZVAL_IF_NOT_REF(z);
binary_op(z, z, value TSRMLS_CC);
if (opline->extended_value == ZEND_ASSIGN_OBJ) {
@@ -16367,7 +16367,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_VAR_TMP(int
(*bin
}
z = value;
}
- Z_ADDREF_P(z);
+ if (Z_REFCOUNTED_P(z)) Z_ADDREF_P(z);
SEPARATE_ZVAL_IF_NOT_REF(z);
binary_op(z, z, value TSRMLS_CC);
if (opline->extended_value == ZEND_ASSIGN_OBJ) {
@@ -18378,7 +18378,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_VAR_VAR(int
(*bin
}
z = value;
}
- Z_ADDREF_P(z);
+ if (Z_REFCOUNTED_P(z)) Z_ADDREF_P(z);
SEPARATE_ZVAL_IF_NOT_REF(z);
binary_op(z, z, value TSRMLS_CC);
if (opline->extended_value == ZEND_ASSIGN_OBJ) {
@@ -20508,7 +20508,7 @@ static int ZEND_FASTCALL
zend_binary_assign_op_obj_helper_SPEC_VAR_UNUSED(int (*
}
z = value;
}
- Z_ADDREF_P(z);
+ if (Z_REFCOUNTED_P(z)) Z_ADDREF_P(z);
SEPARATE_ZVAL_IF_NOT_REF(z);
binary_op(z, z, value TSRMLS_CC);
if (opline->extended_value == ZEND_ASSIGN_OBJ) {
@@ -21904,7 +21904,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_VAR_CV(int
(*bina
}
z = value;
}
- Z_ADDREF_P(z);
+ if (Z_REFCOUNTED_P(z)) Z_ADDREF_P(z);
SEPARATE_ZVAL_IF_NOT_REF(z);
binary_op(z, z, value TSRMLS_CC);
if (opline->extended_value == ZEND_ASSIGN_OBJ) {
@@ -23773,7 +23773,7 @@ static int ZEND_FASTCALL
zend_binary_assign_op_obj_helper_SPEC_UNUSED_CONST(int
}
z = value;
}
- Z_ADDREF_P(z);
+ if (Z_REFCOUNTED_P(z)) Z_ADDREF_P(z);
SEPARATE_ZVAL_IF_NOT_REF(z);
binary_op(z, z, value TSRMLS_CC);
if (opline->extended_value == ZEND_ASSIGN_OBJ) {
@@ -25130,7 +25130,7 @@ static int ZEND_FASTCALL
zend_binary_assign_op_obj_helper_SPEC_UNUSED_TMP(int (*
}
z = value;
}
- Z_ADDREF_P(z);
+ if (Z_REFCOUNTED_P(z)) Z_ADDREF_P(z);
SEPARATE_ZVAL_IF_NOT_REF(z);
binary_op(z, z, value TSRMLS_CC);
if (opline->extended_value == ZEND_ASSIGN_OBJ) {
@@ -26404,7 +26404,7 @@ static int ZEND_FASTCALL
zend_binary_assign_op_obj_helper_SPEC_UNUSED_VAR(int (*
}
z = value;
}
- Z_ADDREF_P(z);
+ if (Z_REFCOUNTED_P(z)) Z_ADDREF_P(z);
SEPARATE_ZVAL_IF_NOT_REF(z);
binary_op(z, z, value TSRMLS_CC);
if (opline->extended_value == ZEND_ASSIGN_OBJ) {
@@ -27679,7 +27679,7 @@ static int ZEND_FASTCALL
zend_binary_assign_op_obj_helper_SPEC_UNUSED_UNUSED(int
}
z = value;
}
- Z_ADDREF_P(z);
+ if (Z_REFCOUNTED_P(z)) Z_ADDREF_P(z);
SEPARATE_ZVAL_IF_NOT_REF(z);
binary_op(z, z, value TSRMLS_CC);
if (opline->extended_value == ZEND_ASSIGN_OBJ) {
@@ -28081,7 +28081,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_UNUSED_CV(int
(*b
}
z = value;
}
- Z_ADDREF_P(z);
+ if (Z_REFCOUNTED_P(z)) Z_ADDREF_P(z);
SEPARATE_ZVAL_IF_NOT_REF(z);
binary_op(z, z, value TSRMLS_CC);
if (opline->extended_value == ZEND_ASSIGN_OBJ) {
@@ -30832,7 +30832,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_CV_CONST(int
(*bi
}
z = value;
}
- Z_ADDREF_P(z);
+ if (Z_REFCOUNTED_P(z)) Z_ADDREF_P(z);
SEPARATE_ZVAL_IF_NOT_REF(z);
binary_op(z, z, value TSRMLS_CC);
if (opline->extended_value == ZEND_ASSIGN_OBJ) {
@@ -33049,7 +33049,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_CV_TMP(int
(*bina
}
z = value;
}
- Z_ADDREF_P(z);
+ if (Z_REFCOUNTED_P(z)) Z_ADDREF_P(z);
SEPARATE_ZVAL_IF_NOT_REF(z);
binary_op(z, z, value TSRMLS_CC);
if (opline->extended_value == ZEND_ASSIGN_OBJ) {
@@ -34935,7 +34935,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_CV_VAR(int
(*bina
}
z = value;
}
- Z_ADDREF_P(z);
+ if (Z_REFCOUNTED_P(z)) Z_ADDREF_P(z);
SEPARATE_ZVAL_IF_NOT_REF(z);
binary_op(z, z, value TSRMLS_CC);
if (opline->extended_value == ZEND_ASSIGN_OBJ) {
@@ -36940,7 +36940,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_CV_UNUSED(int
(*b
}
z = value;
}
- Z_ADDREF_P(z);
+ if (Z_REFCOUNTED_P(z)) Z_ADDREF_P(z);
SEPARATE_ZVAL_IF_NOT_REF(z);
binary_op(z, z, value TSRMLS_CC);
if (opline->extended_value == ZEND_ASSIGN_OBJ) {
@@ -38205,7 +38205,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_CV_CV(int
(*binar
}
z = value;
}
- Z_ADDREF_P(z);
+ if (Z_REFCOUNTED_P(z)) Z_ADDREF_P(z);
SEPARATE_ZVAL_IF_NOT_REF(z);
binary_op(z, z, value TSRMLS_CC);
if (opline->extended_value == ZEND_ASSIGN_OBJ) {