From: Matthias Braun Date: Tue, 29 Aug 2006 13:26:48 +0000 (+0000) Subject: fix uf_union if merging a set with itself X-Git-Url: http://nsz.repo.hu/git/?a=commitdiff_plain;h=2acd12672889bd30d4c0e8bd10ca992abd24fb01;p=libfirm fix uf_union if merging a set with itself [r8139] --- diff --git a/ir/adt/unionfind.h b/ir/adt/unionfind.h index 055907d64..9364d6b95 100644 --- a/ir/adt/unionfind.h +++ b/ir/adt/unionfind.h @@ -50,6 +50,9 @@ static INLINE int uf_union(int* data, int set1, int set2) { int d2 = data[set2]; int newcount; + if(set1 == set2) + return 0; + // need 2 set represantatives assert(d1 < 0 && d2 < 0);