Opened 21 years ago

Closed 21 years ago

#934 closed Bugs (Fixed)

write_graphviz() crashes on G w/ no edge

Reported by: nobody Owned by: jsiek
Milestone: Component: graph
Version: None Severity:
Keywords: Cc:

Description

In boost 1.21.2, write_graphviz() crashes on an 
adjacency_list graph with no edges.  

Here is the corrected definition of the function that 
crashes:

      template <class G>
      inline adj_list_edge_iterator(VertexIterator b, 
                                    VertexIterator c,
                                    VertexIterator e,
                                    G& g) 
        : vBegin(b), vCurr(c), vEnd(e), m_g(&g) {
        if ( vCurr != vEnd ) {
          while ( vCurr != vEnd && out_degree(*vCurr, 
*m_g) == 0 )
            ++vCurr;
          if( vCurr != vEnd ) {
            tie(eCurr, eEnd) = out_edges(*vCurr, *m_g);
          }
        }
      }

Change History (1)

comment:1 by jsiek, 21 years ago

Status: assignedclosed
Logged In: YES 
user_id=32836

Thanks for the bug fix. I've checked the change into CVS.
Note: See TracTickets for help on using tickets.