com php-src: require guard here too: Zend/zend_vm_def.h Zend/zend_vm_execute.h

From: Date: Sun, 20 Mar 2016 18:05:45 +0000
Subject: com php-src: require guard here too: Zend/zend_vm_def.h Zend/zend_vm_execute.h
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-95664@lists.php.net to get a copy of this message
Commit: 888679570ec1ef1a40d6fbcc48e918dc959632c1 Author: Joe Watkins <krakjoe@php.net> Sun, 20 Mar 2016 18:05:45 +0000 Parents: baa0997f4c0ebc0550ddc1666679033b20ab0453 Branches: typed_ref_properties Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=888679570ec1ef1a40d6fbcc48e918dc959632c1 Log: require guard here too 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 06adce6..da46f32 100644 --- a/Zend/zend_vm_def.h +++ b/Zend/zend_vm_def.h @@ -6236,6 +6236,14 @@ ZEND_VM_HANDLER(125, ZEND_FE_RESET_RW, CONST|TMP|VAR|CV, JMP_ADDR) zend_object_iterator *iter = ce->get_iterator(ce, array_ptr, 1); zend_bool is_empty; + if (UNEXPECTED(ZEND_OBJECT_HAS_TYPE_HINTS(array_ptr))) { + zend_throw_exception_ex( + zend_ce_type_error, 0, + "Typed properties exist in %s: foreach by reference is disallowed", + ZSTR_VAL(Z_OBJCE_P(array_ptr)->name)); + HANDLE_EXCEPTION(); + } + if (UNEXPECTED(!iter) || UNEXPECTED(EG(exception))) { if (OP1_TYPE == IS_VAR) { FREE_OP1_VAR_PTR(); diff --git a/Zend/zend_vm_execute.h b/Zend/zend_vm_execute.h index 6be8026..e59785d 100644 --- a/Zend/zend_vm_execute.h +++ b/Zend/zend_vm_execute.h @@ -4311,6 +4311,14 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FE_RESET_RW_SPEC_CONST_HANDLER zend_object_iterator *iter = ce->get_iterator(ce, array_ptr, 1); zend_bool is_empty; + if (UNEXPECTED(ZEND_OBJECT_HAS_TYPE_HINTS(array_ptr))) { + zend_throw_exception_ex( + zend_ce_type_error, 0, + "Typed properties exist in %s: foreach by reference is disallowed", + ZSTR_VAL(Z_OBJCE_P(array_ptr)->name)); + HANDLE_EXCEPTION(); + } + if (UNEXPECTED(!iter) || UNEXPECTED(EG(exception))) { if (IS_CONST == IS_VAR) { @@ -13206,6 +13214,14 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FE_RESET_RW_SPEC_TMP_HANDLER(Z zend_object_iterator *iter = ce->get_iterator(ce, array_ptr, 1); zend_bool is_empty; + if (UNEXPECTED(ZEND_OBJECT_HAS_TYPE_HINTS(array_ptr))) { + zend_throw_exception_ex( + zend_ce_type_error, 0, + "Typed properties exist in %s: foreach by reference is disallowed", + ZSTR_VAL(Z_OBJCE_P(array_ptr)->name)); + HANDLE_EXCEPTION(); + } + if (UNEXPECTED(!iter) || UNEXPECTED(EG(exception))) { if (IS_TMP_VAR == IS_VAR) { @@ -16796,6 +16812,14 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FE_RESET_RW_SPEC_VAR_HANDLER(Z zend_object_iterator *iter = ce->get_iterator(ce, array_ptr, 1); zend_bool is_empty; + if (UNEXPECTED(ZEND_OBJECT_HAS_TYPE_HINTS(array_ptr))) { + zend_throw_exception_ex( + zend_ce_type_error, 0, + "Typed properties exist in %s: foreach by reference is disallowed", + ZSTR_VAL(Z_OBJCE_P(array_ptr)->name)); + HANDLE_EXCEPTION(); + } + if (UNEXPECTED(!iter) || UNEXPECTED(EG(exception))) { if (IS_VAR == IS_VAR) { if (UNEXPECTED(free_op1)) {zval_ptr_dtor_nogc(free_op1);}; @@ -37069,6 +37093,14 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FE_RESET_RW_SPEC_CV_HANDLER(ZE zend_object_iterator *iter = ce->get_iterator(ce, array_ptr, 1); zend_bool is_empty; + if (UNEXPECTED(ZEND_OBJECT_HAS_TYPE_HINTS(array_ptr))) { + zend_throw_exception_ex( + zend_ce_type_error, 0, + "Typed properties exist in %s: foreach by reference is disallowed", + ZSTR_VAL(Z_OBJCE_P(array_ptr)->name)); + HANDLE_EXCEPTION(); + } + if (UNEXPECTED(!iter) || UNEXPECTED(EG(exception))) { if (IS_CV == IS_VAR) {

« previous php.cvs (#95664) next »