Skip to content

Commit 70c634f

Browse files
bug symfony#25119 [DI] Fix infinite loop when analyzing references (nicolas-grekas)
This PR was merged into the 3.4 branch. Discussion ---------- [DI] Fix infinite loop when analyzing references | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | symfony#25101 | License | MIT | Doc PR | - Commits ------- f772d2f [DI] Fix infinite loop when analyzing references
2 parents 259ac66 + f772d2f commit 70c634f

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -356,6 +356,7 @@ private function analyzeCircularReferences(array $edges, &$checkedNodes, &$curre
356356
if (isset($checkedNodes[$id])) {
357357
continue;
358358
}
359+
$checkedNodes[$id] = true;
359360

360361
if ($node->getValue() && ($edge->isLazy() || $edge->isWeak())) {
361362
// no-op
@@ -367,10 +368,8 @@ private function analyzeCircularReferences(array $edges, &$checkedNodes, &$curre
367368
} else {
368369
$currentPath[$id] = $id;
369370
$this->analyzeCircularReferences($node->getOutEdges(), $checkedNodes, $currentPath);
371+
array_pop($currentPath);
370372
}
371-
372-
$checkedNodes[$id] = true;
373-
array_pop($currentPath);
374373
}
375374
}
376375

0 commit comments

Comments
 (0)