twa: fix issue #555 better

Reported by Dávid Smolka.

* spot/twa/twagraph.cc (defrag_states): Also ignore edges with erased
source when updating highlight-edges.
* tests/python/parsetgba.py: Add Dávid's test case.
This commit is contained in:
Alexandre Duret-Lutz 2023-12-03 22:26:12 +01:00
parent 3d05ecb4ac
commit 444d4f773d
2 changed files with 47 additions and 2 deletions

View file

@ -1287,7 +1287,7 @@ namespace spot
("highlight-edges"))
{
// Unfortunately, the underlying graph, who might remove some
// edges, know nothing about named properties. So we have to
// edges, knows nothing about named properties. So we have to
// predict the indices of the edges after
// graph::defrag_states() will run. This might break if
// graph::defrag_states() is changed.
@ -1297,7 +1297,9 @@ namespace spot
unsigned edgeidx = 1;
for (unsigned e = 1; e < es; ++e)
{
if (is_dead_edge(e) || newst[ev[e].dst] == -1U)
if (is_dead_edge(e)
|| newst[ev[e].dst] == -1U
|| newst[ev[e].src] == -1U)
newedges[e] = -1U;
else
newedges[e] = edgeidx++;