com php-src: Fixed immutable array support: Zend/zend_vm_de f.h Zend/zend_vm_execute.h

From: Date: Wed, 20 Aug 2014 17:42:49 +0000
Subject: com php-src: Fixed immutable array support: Zend/zend_vm_de f.h Zend/zend_vm_execute.h
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-80647@lists.php.net to get a copy of this message
Commit: 9507aa99fc068578fc1ab28a61bb4d122f8b6eff Author: Dmitry Stogov <dmitry@zend.com> Wed, 20 Aug 2014 21:42:49 +0400 Parents: d37820ff5be71e0e0a8d769cbb2fc6a248b87957 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=9507aa99fc068578fc1ab28a61bb4d122f8b6eff Log: Fixed immutable array support 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 a50f143..c804420 100644 --- a/Zend/zend_vm_def.h +++ b/Zend/zend_vm_def.h @@ -4539,7 +4539,7 @@ 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) { + } else if (OP1_TYPE == IS_CV || OP1_TYPE == IS_VAR) { if (Z_ISREF_P(array_ref) && Z_REFCOUNT_P(array_ref) == 1) { ZVAL_UNREF(array_ref); array_ptr = array_ref; @@ -4553,7 +4553,9 @@ ZEND_VM_HANDLER(77, ZEND_FE_RESET, CONST|TMP|VAR|CV, ANY) } zval_copy_ctor(array_ptr); } - Z_ADDREF_P(array_ref); + if (OP1_TYPE == IS_CV) { + Z_ADDREF_P(array_ref); + } } } } diff --git a/Zend/zend_vm_execute.h b/Zend/zend_vm_execute.h index f1909b6..46fc39e 100644 --- a/Zend/zend_vm_execute.h +++ b/Zend/zend_vm_execute.h @@ -3156,7 +3156,7 @@ 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) { + } else if (IS_CONST == IS_CV || IS_CONST == IS_VAR) { if (Z_ISREF_P(array_ref) && Z_REFCOUNT_P(array_ref) == 1) { ZVAL_UNREF(array_ref); array_ptr = array_ref; @@ -3170,7 +3170,9 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_A } zval_copy_ctor(array_ptr); } - Z_ADDREF_P(array_ref); + if (IS_CONST == IS_CV) { + Z_ADDREF_P(array_ref); + } } } } @@ -8679,7 +8681,7 @@ 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) { + } else if (IS_TMP_VAR == IS_CV || IS_TMP_VAR == IS_VAR) { if (Z_ISREF_P(array_ref) && Z_REFCOUNT_P(array_ref) == 1) { ZVAL_UNREF(array_ref); array_ptr = array_ref; @@ -8693,7 +8695,9 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARG } zval_copy_ctor(array_ptr); } - Z_ADDREF_P(array_ref); + if (IS_TMP_VAR == IS_CV) { + Z_ADDREF_P(array_ref); + } } } } @@ -14122,7 +14126,7 @@ 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) { + } else if (IS_VAR == IS_CV || IS_VAR == IS_VAR) { if (Z_ISREF_P(array_ref) && Z_REFCOUNT_P(array_ref) == 1) { ZVAL_UNREF(array_ref); array_ptr = array_ref; @@ -14136,7 +14140,9 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG } zval_copy_ctor(array_ptr); } - Z_ADDREF_P(array_ref); + if (IS_VAR == IS_CV) { + Z_ADDREF_P(array_ref); + } } } } @@ -31483,7 +31489,7 @@ 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) { + } else if (IS_CV == IS_CV || IS_CV == IS_VAR) { if (Z_ISREF_P(array_ref) && Z_REFCOUNT_P(array_ref) == 1) { ZVAL_UNREF(array_ref); array_ptr = array_ref; @@ -31497,7 +31503,9 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS } zval_copy_ctor(array_ptr); } - Z_ADDREF_P(array_ref); + if (IS_CV == IS_CV) { + Z_ADDREF_P(array_ref); + } } } }

« previous php.cvs (#80647) next »