com php-src: Fixed reference afto conversion: Zend/zend_vm_ def.h Zend/zend_vm_execute.h

From: Date: Wed, 12 Mar 2014 08:07:03 +0000
Subject: com php-src: Fixed reference afto conversion: Zend/zend_vm_ def.h Zend/zend_vm_execute.h
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-77706@lists.php.net to get a copy of this message
Commit: 72f738c368106d9e535f7e20a68ed7f26a6665cf Author: Dmitry Stogov <dmitry@zend.com> Wed, 12 Mar 2014 12:07:03 +0400 Parents: d708d3c596aa16afa9ca4906ea1fa6579b74b494 Branches: phpng Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=72f738c368106d9e535f7e20a68ed7f26a6665cf Log: Fixed reference afto conversion 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 0d59489..6e94c3d 100644 --- a/Zend/zend_vm_def.h +++ b/Zend/zend_vm_def.h @@ -4338,7 +4338,19 @@ ZEND_VM_HANDLER(77, ZEND_FE_RESET, CONST|TMP|VAR|CV, ANY) ZVAL_DUP(&tmp, array_ref); array_ptr = array_ref = &tmp; } else if (OP1_TYPE == IS_CV) { - Z_ADDREF_P(array_ref); +//??? dereference + if (Z_ISREF_P(array_ref)) { + if (Z_REFCOUNT_P(array_ref) == 1) { + zend_reference *ref = Z_REF_P(array_ref); + ZVAL_COPY(array_ref, &ref->val); + efree(ref); + array_ptr = array_ref; + } else { + Z_ADDREF_P(array_ref); + } + } else { + Z_ADDREF_P(array_ref); + } } } } diff --git a/Zend/zend_vm_execute.h b/Zend/zend_vm_execute.h index e33ad57..2742b84 100644 --- a/Zend/zend_vm_execute.h +++ b/Zend/zend_vm_execute.h @@ -3076,7 +3076,19 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_A ZVAL_DUP(&tmp, array_ref); array_ptr = array_ref = &tmp; } else if (IS_CONST == IS_CV) { - Z_ADDREF_P(array_ref); +//??? dereference + if (Z_ISREF_P(array_ref)) { + if (Z_REFCOUNT_P(array_ref) == 1) { + zend_reference *ref = Z_REF_P(array_ref); + ZVAL_COPY(array_ref, &ref->val); + efree(ref); + array_ptr = array_ref; + } else { + Z_ADDREF_P(array_ref); + } + } else { + Z_ADDREF_P(array_ref); + } } } } @@ -8175,7 +8187,19 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARG ZVAL_DUP(&tmp, array_ref); array_ptr = array_ref = &tmp; } else if (IS_TMP_VAR == IS_CV) { - Z_ADDREF_P(array_ref); +//??? dereference + if (Z_ISREF_P(array_ref)) { + if (Z_REFCOUNT_P(array_ref) == 1) { + zend_reference *ref = Z_REF_P(array_ref); + ZVAL_COPY(array_ref, &ref->val); + efree(ref); + array_ptr = array_ref; + } else { + Z_ADDREF_P(array_ref); + } + } else { + Z_ADDREF_P(array_ref); + } } } } @@ -13347,7 +13371,19 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG ZVAL_DUP(&tmp, array_ref); array_ptr = array_ref = &tmp; } else if (IS_VAR == IS_CV) { - Z_ADDREF_P(array_ref); +//??? dereference + if (Z_ISREF_P(array_ref)) { + if (Z_REFCOUNT_P(array_ref) == 1) { + zend_reference *ref = Z_REF_P(array_ref); + ZVAL_COPY(array_ref, &ref->val); + efree(ref); + array_ptr = array_ref; + } else { + Z_ADDREF_P(array_ref); + } + } else { + Z_ADDREF_P(array_ref); + } } } } @@ -30717,7 +30753,19 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS ZVAL_DUP(&tmp, array_ref); array_ptr = array_ref = &tmp; } else if (IS_CV == IS_CV) { - Z_ADDREF_P(array_ref); +//??? dereference + if (Z_ISREF_P(array_ref)) { + if (Z_REFCOUNT_P(array_ref) == 1) { + zend_reference *ref = Z_REF_P(array_ref); + ZVAL_COPY(array_ref, &ref->val); + efree(ref); + array_ptr = array_ref; + } else { + Z_ADDREF_P(array_ref); + } + } else { + Z_ADDREF_P(array_ref); + } } } }

« previous php.cvs (#77706) next »