mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-02-20 10:43:29 +00:00
Initialize the graph's depth first order array.
Unreachable nodes will cause the first elements of the array to remain unwritten by df_search. This fixes the segfaults caused by unreachable nodes (the reason they were an internal error before).
This commit is contained in:
parent
a7e9defebd
commit
32556b7210
1 changed files with 1 additions and 1 deletions
|
@ -1042,7 +1042,7 @@ flow_build_dfst (flowgraph_t *graph)
|
|||
set_add (visited, graph->num_nodes);
|
||||
set_add (visited, graph->num_nodes + 1);
|
||||
|
||||
graph->dfo = malloc (graph->num_nodes * sizeof (unsigned));
|
||||
graph->dfo = calloc (graph->num_nodes, sizeof (unsigned));
|
||||
graph->dfst = set_new ();
|
||||
i = graph->num_nodes;
|
||||
df_search (graph, visited, &i, 0);
|
||||
|
|
Loading…
Reference in a new issue