From 2acd12672889bd30d4c0e8bd10ca992abd24fb01 Mon Sep 17 00:00:00 2001 From: Matthias Braun Date: Tue, 29 Aug 2006 13:26:48 +0000 Subject: [PATCH] fix uf_union if merging a set with itself [r8139] --- ir/adt/unionfind.h | 3 +++ 1 file changed, 3 insertions(+) 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); -- 2.20.1