1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-20 07:25:23 +02:00

Bug 503988 - UI thread got blocked by the reconciler

Added protection against infinite loops.

Change-Id: I0cc3f34ddb9db9d3a23dfd111836a2a84620e8d9
This commit is contained in:
Sergey Prigogin 2016-10-06 11:09:22 -07:00
parent 04e31e3fae
commit 9f7af7a493

View file

@ -184,9 +184,13 @@ public class HashTable implements Cloneable {
} else { } else {
// Need to link. // Need to link.
j--; j--;
int k; int maxIterationsLeft = nextTable.length;
while ((k = nextTable[j]) != 0 && k != j + 1) { for (int k; (k = nextTable[j]) != 0 && k != j + 1; j = k - 1) {
j = k - 1; if (--maxIterationsLeft < 0) {
throw new IllegalStateException("i = " + i + " hash = " + hash + " j = " + j //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ "\n nextTable = " + Arrays.toString(nextTable) //$NON-NLS-1$
+ "\n hashTable = " + Arrays.toString(hashTable)); //$NON-NLS-1$
}
} }
nextTable[j] = i + 1; nextTable[j] = i + 1;
} }