]> git.ipfire.org Git - thirdparty/gcc.git/commit
analyzer: gracefully handle impossible paths in shortest-paths.h
authorDavid Malcolm <dmalcolm@redhat.com>
Thu, 11 Mar 2021 22:43:39 +0000 (17:43 -0500)
committerDavid Malcolm <dmalcolm@redhat.com>
Thu, 11 Mar 2021 22:43:39 +0000 (17:43 -0500)
commit3f958348e78f38d91f0611618bb909182170c0f3
tree4825f1b0a8f3500fb176782a3474c3bf563bb310
parentc4f8e568aa66a8461ee39d5f85c2e2d41a833b7f
analyzer: gracefully handle impossible paths in shortest-paths.h

This bulletproofs the shortest_paths code against unreachable nodes,
gracefully handling them, rather than failing an assertion.

I've marked this as "analyzer" as this is the only code using
shortest-paths.h.

This patch is required by followup work to fix PR analyzer/96374.

gcc/ChangeLog:
* digraph.cc (selftest::test_shortest_paths): Add test coverage
for paths from B and C.
* shortest-paths.h (shortest_paths::shortest_paths): Handle
unreachable nodes, rather than asserting.
gcc/digraph.cc
gcc/shortest-paths.h