From 9db967be9827d44150a840f52ecd1e0f28b5bd4e Mon Sep 17 00:00:00 2001 From: Todd Gamblin Date: Sat, 10 Jan 2015 19:23:07 -0800 Subject: Fix bug when all deps are back edges. - Happened with the graph for SAMRAI --- lib/spack/spack/graph.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'lib') diff --git a/lib/spack/spack/graph.py b/lib/spack/spack/graph.py index bebb68d06a..5fb6a9cd23 100644 --- a/lib/spack/spack/graph.py +++ b/lib/spack/spack/graph.py @@ -426,10 +426,13 @@ class AsciiGraph(object): self._back_edge_line(prev_ends, b, i, False, 'left-1') del prev_ends[:] prev_ends.append(b) - self._back_edge_line(prev_ends, -1, -1, False, 'left-2') - if not self._frontier[i]: - self._frontier.pop(i) + # Check whether we did ALL the deps as back edges, + # in which case we're done. + collapse = not self._frontier[i] + if collapse: + self._frontier.pop(i) + self._back_edge_line(prev_ends, -1, -1, collapse, 'left-2') elif len(self._frontier[i]) > 1: # Expand forward after doing all back connections -- cgit v1.2.3-60-g2f50