Ticket #53 (closed defect: fixed)

Opened 2 years ago

Last modified 2 years ago

_makeCircularException seems to have an infinite loop

Reported by: scott.pascoe@gmail.com Assigned to:
Priority: minor Milestone: 2.3.0
Component: Version: 2.2.0RC3
Keywords: Cc:

Description

In the file: trunk/classes/phing/Project.php, there is a method _makeCircularException defined at line 840.

This method mentions a local variable $c, which is uninitialized and referenced only in the while of a do/while loop.

It seems that $c will never = $end and therefore the loop is infinite.

If I am correct, then I think it probably should be coded as:

    function _makeCircularException($end, $stk) {
        $sb = "Circular dependency: $end";
        do {
	    $c = (string) array_pop($stk);
            $sb .= " <- ".$c;
        } while($c != $end);
        return new BuildException($sb);
    }

Thanks, Scott Pascoe

Attachments

Change History

12/28/06 11:18:54 changed by mrook

  • status changed from new to closed.
  • resolution set to fixed.

Fixed in r130, thanks!


Add/Change #53 (_makeCircularException seems to have an infinite loop)




Action