com php-src: Fixed assignment of "new" by reference: Zend/zend_vm_def.h Zend/zend_vm_execute.h
| From: | Dmitry Stogov | Date: | Wed, 19 Mar 2014 19:51:28 +0000 |
| Subject: | com php-src: Fixed assignment of "new" by reference: Zend/zend_vm_def.h Zend/zend_vm_execute.h | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-77596@lists.php.net to get a copy of this message | ||
Commit: 3c0feb51bc16626aabae983444934dc4b6328b2f
Author: Dmitry Stogov <dmitry@zend.com> Wed, 19 Mar 2014 23:51:28 +0400
Parents: 5db78476e310bef25c6e0a9f0c4c07d6f2532a15
Branches: phpng
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=3c0feb51bc16626aabae983444934dc4b6328b2f
Log:
Fixed assignment of "new" by reference
Changed paths:
M Zend/zend_vm_def.h
M Zend/zend_vm_execute.h
Diff:
diff --git a/Zend/zend_vm_def.h b/Zend/zend_vm_def.h
index 8076ba6..d98087a 100644
--- a/Zend/zend_vm_def.h
+++ b/Zend/zend_vm_def.h
@@ -1841,7 +1841,9 @@ ZEND_VM_HANDLER(39, ZEND_ASSIGN_REF, VAR|CV, VAR|CV)
zend_assign_to_variable_reference(variable_ptr, value_ptr TSRMLS_CC);
if (OP2_TYPE == IS_VAR && opline->extended_value == ZEND_RETURNS_NEW) {
-//??? Z_DELREF_P(variable_ptr);
+ if (!OP2_FREE) {
+ Z_DELREF_P(variable_ptr);
+ }
}
if (RETURN_VALUE_USED(opline)) {
diff --git a/Zend/zend_vm_execute.h b/Zend/zend_vm_execute.h
index c635d8a..f8429bc 100644
--- a/Zend/zend_vm_execute.h
+++ b/Zend/zend_vm_execute.h
@@ -19821,7 +19821,9 @@ static int ZEND_FASTCALL
ZEND_ASSIGN_REF_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDL
zend_assign_to_variable_reference(variable_ptr, value_ptr TSRMLS_CC);
if (IS_VAR == IS_VAR && opline->extended_value == ZEND_RETURNS_NEW) {
-//??? Z_DELREF_P(variable_ptr);
+ if (!(free_op2.var != NULL)) {
+ Z_DELREF_P(variable_ptr);
+ }
}
if (RETURN_VALUE_USED(opline)) {
@@ -23265,7 +23267,9 @@ static int ZEND_FASTCALL
ZEND_ASSIGN_REF_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLE
zend_assign_to_variable_reference(variable_ptr, value_ptr TSRMLS_CC);
if (IS_CV == IS_VAR && opline->extended_value == ZEND_RETURNS_NEW) {
-//??? Z_DELREF_P(variable_ptr);
+ if (!0) {
+ Z_DELREF_P(variable_ptr);
+ }
}
if (RETURN_VALUE_USED(opline)) {
@@ -36856,7 +36860,9 @@ static int ZEND_FASTCALL
ZEND_ASSIGN_REF_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLE
zend_assign_to_variable_reference(variable_ptr, value_ptr TSRMLS_CC);
if (IS_VAR == IS_VAR && opline->extended_value == ZEND_RETURNS_NEW) {
-//??? Z_DELREF_P(variable_ptr);
+ if (!(free_op2.var != NULL)) {
+ Z_DELREF_P(variable_ptr);
+ }
}
if (RETURN_VALUE_USED(opline)) {
@@ -40040,7 +40046,9 @@ static int ZEND_FASTCALL
ZEND_ASSIGN_REF_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER
zend_assign_to_variable_reference(variable_ptr, value_ptr TSRMLS_CC);
if (IS_CV == IS_VAR && opline->extended_value == ZEND_RETURNS_NEW) {
-//??? Z_DELREF_P(variable_ptr);
+ if (!0) {
+ Z_DELREF_P(variable_ptr);
+ }
}
if (RETURN_VALUE_USED(opline)) {