[xdebug-dev] xdebug xdebug/xdebug_code_coverage.c xdebug/tests/bug00422.inc xdebug/tests/bug00422.phpt - MFH: Fixed bug #422: Segfaults when using code coverage with a parse error in

From: Derick Rethans <derick[@]derickrethans.nl>
Date: Sat, 24 Jan 2009 21:02:21 +0100

Date: Sat Jan 24 21:02:21 CET 2009
User: Derick Rethans
Directory: xdebug

Log Message:
[4.00]
- MFH: Fixed bug #422: Segfaults when using code coverage with a parse error in
  the script.

Modified files:
           xdebug/xdebug_code_coverage.c (version: 1.32.2.13)
Added files:
           xdebug/tests/bug00422.inc (new version: 1.1.2.2)
           xdebug/tests/bug00422.phpt (new version: 1.1.2.2)

[FILE: /xdebug/xdebug_code_coverage.c]

===================================================================
RCS file: cvstemp,v
retrieving revision 1.32.2.12
retrieving revision 1.32.2.13
diff -u -r1.32.2.12 -r1.32.2.13
--- xdebug/xdebug_code_coverage.c:1.32.2.12 Wed May 21 12:30:38 2008 GMT
+++ xdebug/xdebug_code_coverage.c Sat Jan 24 19:02:21 2009 GMT
@@ -252,7 +252,7 @@
 #endif
 
         /* Run dead code analysis if requested */
- if (XG(code_coverage_dead_code_analysis)) {
+ if (XG(code_coverage_dead_code_analysis) && opa->done_pass_two) {
                 set = xdebug_set_create(opa->last);
                 xdebug_analyse_branch(opa, 0, set);
         }

[FILE: /xdebug/tests/bug00422.inc]

<?php
class DB
{
    function f()
    {
        if (true) {}
        $obj =& new a;
    }
}
?>

[FILE: /xdebug/tests/bug00422.phpt]

--TEST--
Test for bug #422: Segfaults when using code coverage with a parse error in the script.
--SKIPIF--
<?php if (!extension_loaded("xdebug")) print "skip"; ?>
<?php if(version_compare(zend_version(), "2.0.0-dev", '<')) echo "skip Zend Engine 2 needed\n"; ?>
--INI--
xdebug.default_enable=1
xdebug.auto_trace=0
xdebug.trace_options=0
xdebug.trace_output_dir=/tmp
xdebug.collect_params=1
xdebug.collect_return=0
xdebug.auto_profile=0
xdebug.profiler_enable=0
xdebug.dump_globals=0
xdebug.show_mem_delta=0
xdebug.trace_format=0
xdebug.extended_info=1
--FILE--
<?php
function hdl(){}
set_error_handler('hdl');
xdebug_start_code_coverage(XDEBUG_CC_UNUSED | XDEBUG_CC_DEAD_CODE);
require_once 'bug00422.inc';
echo "END";
?>
--EXPECT--
END
Received on Sat Jan 24 2009 - 21:13:06 GMT

This archive was generated by hypermail 2.2.0 : Sun Jun 24 2018 - 04:00:03 BST