mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-23 14:42:11 +02:00
[Bug 147999] CModelBuilder runs into infinite loop
Additional check to avoid looping in "nextTable[]" values
This commit is contained in:
parent
cd052ee5de
commit
eb6414526f
2 changed files with 2 additions and 2 deletions
|
@ -159,7 +159,7 @@ public class CharTable extends HashTable {
|
||||||
return i;
|
return i;
|
||||||
|
|
||||||
// Follow the next chain
|
// Follow the next chain
|
||||||
for (i = nextTable[i] - 1; i >= 0; i = nextTable[i] - 1)
|
for (i = nextTable[i] - 1; i >= 0 && nextTable[i] != i + 1; i = nextTable[i] - 1)
|
||||||
if (CharArrayUtils.equals(buffer, start, len, keyTable[i]))
|
if (CharArrayUtils.equals(buffer, start, len, keyTable[i]))
|
||||||
return i;
|
return i;
|
||||||
|
|
||||||
|
|
|
@ -120,7 +120,7 @@ public abstract class ObjectTable extends HashTable implements Cloneable{
|
||||||
return i;
|
return i;
|
||||||
|
|
||||||
// Follow the next chain
|
// Follow the next chain
|
||||||
for (i = nextTable[i] - 1; i >= 0; i = nextTable[i] - 1)
|
for (i = nextTable[i] - 1; i >= 0 && nextTable[i] != i + 1; i = nextTable[i] - 1)
|
||||||
if ( buffer.equals( keyTable[i] ))
|
if ( buffer.equals( keyTable[i] ))
|
||||||
return i;
|
return i;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue