]> granicus.if.org Git - php/commitdiff
Do not mark automatic return 1; as executable
authorBob Weinand <bobwei9@hotmail.com>
Fri, 31 Jul 2015 00:26:28 +0000 (02:26 +0200)
committerBob Weinand <bobwei9@hotmail.com>
Fri, 31 Jul 2015 00:26:28 +0000 (02:26 +0200)
sapi/phpdbg/phpdbg.c

index 874704bc6327cb25b6f2f4105518f17c9a3516d2..ca86a29fcff8f4a9edc0fc58bdc853c76fc90740 100644 (file)
@@ -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--;
        }