Commit df3c2945 by Bin Cheng Committed by Bin Cheng

tree-predcom.c (determine_roots_comp): Avoid memory leak by freeing reference of trivial component.

	* tree-predcom.c (determine_roots_comp): Avoid memory leak by freeing
	reference of trivial component.

From-SVN: r254625
parent 8cd119d8
2017-11-10 Bin Cheng <bin.cheng@arm.com>
* tree-predcom.c (determine_roots_comp): Avoid memory leak by freeing
reference of trivial component.
2017-11-10 Jakub Jelinek <jakub@redhat.com> 2017-11-10 Jakub Jelinek <jakub@redhat.com>
PR bootstrap/82916 PR bootstrap/82916
...@@ -1331,7 +1331,14 @@ determine_roots_comp (struct loop *loop, ...@@ -1331,7 +1331,14 @@ determine_roots_comp (struct loop *loop,
/* Trivial component. */ /* Trivial component. */
if (comp->refs.length () <= 1) if (comp->refs.length () <= 1)
return; {
if (comp->refs.length () == 1)
{
free (comp->refs[0]);
comp->refs.truncate (0);
}
return;
}
comp->refs.qsort (order_drefs); comp->refs.qsort (order_drefs);
FOR_EACH_VEC_ELT (comp->refs, i, a) FOR_EACH_VEC_ELT (comp->refs, i, a)
......
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