Use the correct type when allocating flow node edges.

sizeof (struct) vs sizeof (struct *). Ouch.
This commit is contained in:
Bill Currie 2013-01-30 18:08:59 +09:00
parent 6a3c775270
commit 9d418379bf

View file

@ -983,7 +983,7 @@ flow_make_edges (flowgraph_t *graph)
if (graph->edges); if (graph->edges);
free (graph->edges); free (graph->edges);
graph->edges = malloc (graph->num_edges * sizeof (flowedge_t *)); graph->edges = malloc (graph->num_edges * sizeof (flowedge_t));
for (j = 0, i = 0; i < graph->num_nodes + 2; i++) { for (j = 0, i = 0; i < graph->num_nodes + 2; i++) {
node = graph->nodes[i]; node = graph->nodes[i];
for (succ = set_first (node->successors); succ; for (succ = set_first (node->successors); succ;