domtree: domtree_build() creates extraneous bb->doms entries

Each time domtree_build gets called, extraneous/duplicated child nodes
get left in the bb->doms ptrlist. This is because the existing children
are not cleared from bb->doms before rebuilding it.

In addition to consuming memory, the extraneous child nodes result
in a malformed dominance tree.

The following 3 line patch fixes this problem by freeing the dominator
tree before rebuilding it.

Signed-off-by: Xan Phung <xan.phung@gmail.com>
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
1 file changed