com php-src: Do not include zend_verify_return_type in executable ops (phpdbg): Zend/zend_compile.c sapi/phpdbg/phpdbg.c
| From: | Bob Weinand | Date: | Fri, 02 Oct 2015 10:37:39 +0000 |
| Subject: | com php-src: Do not include zend_verify_return_type in executable ops (phpdbg): Zend/zend_compile.c sapi/phpdbg/phpdbg.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-89260@lists.php.net to get a copy of this message | ||
Commit: 6c61286da4f2d71e659da70842168d71835292f9
Author: Bob Weinand <bobwei9@hotmail.com> Fri, 2 Oct 2015 11:43:52 +0200
Parents: 1287c48082adab66b07d8590390330278a4e0c9c
Branches: PHP-7.0
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=6c61286da4f2d71e659da70842168d71835292f9
Log:
Do not include zend_verify_return_type in executable ops (phpdbg)
Changed paths:
M Zend/zend_compile.c
M sapi/phpdbg/phpdbg.c
Diff:
diff --git a/Zend/zend_compile..c b/Zend/zend_compile.c
index ce3815c..98af0a7 100644
--- a/Zend/zend_compile.c
+++ b/Zend/zend_compile.c
@@ -2042,6 +2042,7 @@ static void zend_emit_return_type_check(znode *expr, zend_arg_info
*return_info)
void zend_emit_final_return(zval *zv) /* {{{ */
{
znode zn;
+ zend_op *ret;
zend_bool returns_reference = (CG(active_op_array)->fn_flags & ZEND_ACC_RETURN_REFERENCE)
!= 0;
if (CG(active_op_array)->fn_flags & ZEND_ACC_HAS_RETURN_TYPE) {
@@ -2055,7 +2056,8 @@ void zend_emit_final_return(zval *zv) /* {{{ */
ZVAL_NULL(&zn.u.constant);
}
- zend_emit_op(NULL, returns_reference ? ZEND_RETURN_BY_REF : ZEND_RETURN, &zn, NULL);
+ ret = zend_emit_op(NULL, returns_reference ? ZEND_RETURN_BY_REF : ZEND_RETURN, &zn, NULL);
+ ret->extended_value = -1;
}
/* }}} */
diff --git a/sapi/phpdbg/phpdbg.c b/sapi/phpdbg/phpdbg.c
index cc3de42..30edec4 100644
--- a/sapi/phpdbg/phpdbg.c
+++ b/sapi/phpdbg/phpdbg.c
@@ -443,14 +443,14 @@ static void phpdbg_oplog_fill_executable(zend_op_array *op_array, HashTable
*ins
ZVAL_LONG(&zero, 0);
/* ignore autogenerated return (well, not too precise with finally branches, but that's okay)
*/
- if (op_array->last >= 1 && (end - 1)->opcode == ZEND_RETURN
- && ((op_array->last > 1 && ((end - 2)->opcode == ZEND_RETURN || (end -
2)->opcode == ZEND_GENERATOR_RETURN || (end - 2)->opcode == ZEND_THROW))
- || op_array->function_name == NULL)) {
+ if (op_array->last >= 1 && (((end - 1)->opcode == ZEND_RETURN || (end -
1)->opcode == ZEND_RETURN_BY_REF || (end - 1)->opcode == ZEND_GENERATOR_RETURN)
+ && ((op_array->last > 1 && ((end - 2)->opcode == ZEND_RETURN || (end -
2)->opcode == ZEND_RETURN_BY_REF || (end - 2)->opcode == ZEND_GENERATOR_RETURN || (end -
2)->opcode == ZEND_THROW))
+ || op_array->function_name == NULL || (end - 1)->extended_value == -1))) {
end--;
}
for (; cur < end; cur++) {
- if (cur->opcode == ZEND_NOP || cur->opcode == ZEND_OP_DATA || cur->opcode ==
ZEND_FE_FREE || cur->opcode == ZEND_FREE || cur->opcode == ZEND_ASSERT_CHECK
+ if (cur->opcode == ZEND_NOP || cur->opcode == ZEND_OP_DATA || cur->opcode ==
ZEND_FE_FREE || cur->opcode == ZEND_FREE || cur->opcode == ZEND_ASSERT_CHECK || cur->opcode
== ZEND_VERIFY_RETURN_TYPE
|| cur->opcode == ZEND_DECLARE_CONST || cur->opcode == ZEND_DECLARE_CLASS ||
cur->opcode == ZEND_DECLARE_INHERITED_CLASS || cur->opcode == ZEND_DECLARE_FUNCTION
|| cur->opcode == ZEND_DECLARE_INHERITED_CLASS_DELAYED || cur->opcode ==
ZEND_VERIFY_ABSTRACT_CLASS || cur->opcode == ZEND_ADD_TRAIT || cur->opcode == ZEND_BIND_TRAITS
|| cur->opcode == ZEND_DECLARE_ANON_CLASS || cur->opcode ==
ZEND_DECLARE_ANON_INHERITED_CLASS || cur->opcode == ZEND_FAST_RET || cur->opcode == ZEND_TICKS