summaryrefslogtreecommitdiff
path: root/sapi/phpdbg/phpdbg.c
diff options
context:
space:
mode:
authorBob Weinand <bobwei9@hotmail.com>2015-07-31 02:26:28 +0200
committerBob Weinand <bobwei9@hotmail.com>2015-07-31 02:26:28 +0200
commit36aa92a67ddeaa73754274b05f0ed35006b18ebc (patch)
treee995e1636ffa3476df473c70a46285f205a740e4 /sapi/phpdbg/phpdbg.c
parent1da4ee25b89a668d55064f6cbfd62fcf1c9d00ef (diff)
downloadphp-git-36aa92a67ddeaa73754274b05f0ed35006b18ebc.tar.gz
Do not mark automatic return 1; as executable
Diffstat (limited to 'sapi/phpdbg/phpdbg.c')
-rw-r--r--sapi/phpdbg/phpdbg.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sapi/phpdbg/phpdbg.c b/sapi/phpdbg/phpdbg.c
index 874704bc63..ca86a29fcf 100644
--- a/sapi/phpdbg/phpdbg.c
+++ b/sapi/phpdbg/phpdbg.c
@@ -432,7 +432,9 @@ 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 && ((end - 2)->opcode == ZEND_RETURN || (end - 2)->opcode == ZEND_GENERATOR_RETURN || (end - 2)->opcode == ZEND_THROW)) {
+ 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)) {
end--;
}