Commit 363a0690 by Martin Liska Committed by Martin Liska

Fix segfault in gcov.c (PR gcov-profile/81561).

2017-08-01  Martin Liska  <mliska@suse.cz>

	PR gcov-profile/81561
	* gcov.c (unblock): Make unblocking safe as we need to preserve
	index correspondence of blocks and block_lists.

From-SVN: r250780
parent 0102e469
2017-08-01 Martin Liska <mliska@suse.cz>
PR gcov-profile/81561
* gcov.c (unblock): Make unblocking safe as we need to preserve
index correspondence of blocks and block_lists.
2017-08-01 Richard Biener <rguenther@suse.de> 2017-08-01 Richard Biener <rguenther@suse.de>
PR tree-optimization/81181 PR tree-optimization/81181
......
...@@ -539,13 +539,13 @@ unblock (const block_t *u, block_vector_t &blocked, ...@@ -539,13 +539,13 @@ unblock (const block_t *u, block_vector_t &blocked,
unsigned index = it - blocked.begin (); unsigned index = it - blocked.begin ();
blocked.erase (it); blocked.erase (it);
for (block_vector_t::iterator it2 = block_lists[index].begin (); block_vector_t to_unblock (block_lists[index]);
it2 != block_lists[index].end (); it2++)
unblock (*it2, blocked, block_lists);
for (unsigned j = 0; j < block_lists[index].size (); j++)
unblock (u, blocked, block_lists);
block_lists.erase (block_lists.begin () + index); block_lists.erase (block_lists.begin () + index);
for (block_vector_t::iterator it = to_unblock.begin ();
it != to_unblock.end (); it++)
unblock (*it, blocked, block_lists);
} }
/* Find circuit going to block V, PATH is provisional seen cycle. /* Find circuit going to block V, PATH is provisional seen cycle.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment