MantisBT

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0000472XdebugUsage problems (Wrong Results)public2009-09-19 01:142009-10-15 18:25
Reporterauroraeosrose 
Assigned To 
PrioritynormalSeveritymajorReproducibilityalways
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version2.0.0dev 
Target VersionFixed in Version 
Summary0000472: Dead Code Analysis for code coverage messed up after goto
Descriptionin 5.3 the following code

if ($foo) {
    goto blah;
}

The bottom closing brace always shows up as an "uncovered" line of code
TagsNo tags attached.
Operating SystemN/A
PHP Version5.3.0
Attached Files

- Relationships

-  Notes
(0001083)
derick (administrator)
2009-10-09 14:28

I can not reproduce this with Xdebug from CVS/HEAD:

derick@kossu:~/dev/php/xdebug/tests$ cat bug00472test.php
<?php require 'bug00472.phpt';
class CcTest extends PHPUnit_Framework_TestCase
{
    public function testOne()
    {
        GotoTest::testMethod();
    }
}
?>

derick@kossu:~/dev/php/xdebug/tests$ cat bug00472.phpt
<?php
class GotoTest
{
    static public function testMethod()
    {
        $foo = true;

        if ($foo) {
            goto blah;
        }
        echo 42, "\n";

        blah:
            echo 42, "\n";
    }
}
?>

derick@kossu:~/dev/php/xdebug/tests$ phpunit --coverage-html /tmp/report bug00472test.php

Marks line 10 as grey, and line 11 as red.
(0001084)
auroraeosrose (reporter)
2009-10-09 15:44

put another if anotherneath it

class GotoTest
{
    static public function testMethod()
    {
        $foo = true;
        $bar = false;

        if ($foo) {
            goto blah;
        }
        if ($bar) {
            goto blah;
        }

        blah:
            echo 42, "\n";
    }
}
(0001088)
derick (administrator)
2009-10-10 11:32

That creates: http://files.derickrethans.nl/bug472.png [^] which is what I would expect. Do you get something else?
(0001093)
derick (administrator)
2009-10-15 18:25

Fixed in CVS (HEAD only)

- Issue History
Date Modified Username Field Change
2009-09-19 01:14 auroraeosrose New Issue
2009-09-19 01:14 auroraeosrose Operating System => N/A
2009-09-19 01:14 auroraeosrose PHP Version => 5.3.0
2009-09-19 01:14 auroraeosrose Xdebug Version => 2.0.5
2009-10-09 14:28 derick Note Added: 0001083
2009-10-09 14:28 derick Status new => feedback
2009-10-09 15:44 auroraeosrose Note Added: 0001084
2009-10-10 11:32 derick Note Added: 0001088
2009-10-15 18:25 derick Note Added: 0001093
2009-10-15 18:25 derick Status feedback => closed
2009-10-15 18:25 derick Resolution open => fixed
2016-07-31 13:36 derick Category Usage problems => Usage problems (Crashes)
2016-07-31 13:38 derick Category Usage problems (Crashes) => Usage problems (Wrong Results)


Copyright © 2000 - 2017 MantisBT Team
Powered by Mantis Bugtracker