mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Patches from Thomas Fletcher to deal with some
short comings of the indexer when dealing with Very large scale projects.
This commit is contained in:
parent
74c8d54a44
commit
c5c3b2e7e9
3 changed files with 23 additions and 2 deletions
|
@ -1,3 +1,17 @@
|
|||
2004-02-03 Alain Magloire
|
||||
|
||||
Patches from Thomas Fletcher dealing with the indexer.
|
||||
|
||||
- Remove assumed throw/catch of an exception to be a regular occurance
|
||||
and replace with explicit test and return for bounds access to the
|
||||
particular array.
|
||||
|
||||
- Consider references outside of the mapping range the same as no longer
|
||||
valid mappings (ie -1 entries) and avoid array range exceptions.
|
||||
|
||||
* index/org/eclipse/cdt/internal/core/index/impl/WordEntry.java
|
||||
* index/org/eclipse/cdt/internal/core/index/impl/FileListBlock.java
|
||||
|
||||
2004-01-26 John Camelon
|
||||
Updated clients to use new Scanner logging service.
|
||||
|
||||
|
|
|
@ -63,9 +63,12 @@ public class FileListBlock extends Block {
|
|||
try {
|
||||
String[] paths= getPaths();
|
||||
int i= fileNum - field.getInt4(0);
|
||||
if(i >= paths.length) { //fileNum was too large
|
||||
return null;
|
||||
}
|
||||
resp= new IndexedFile(paths[i], fileNum);
|
||||
} catch (Exception e) {
|
||||
//fileNum too big
|
||||
//Cover ourselves in case something happens getting the indexed file
|
||||
}
|
||||
return resp;
|
||||
}
|
||||
|
|
|
@ -128,8 +128,12 @@ public class WordEntry {
|
|||
*/
|
||||
public void mapRefs(int[] mappings) {
|
||||
int position= 0;
|
||||
|
||||
for (int i= 0; i < fNumRefs; i++) {
|
||||
int map= mappings[fRefs[i]];
|
||||
//Take care that the reference is actually within the bounds of the mapping
|
||||
int map= -1;
|
||||
if(fRefs[i] >= 0 && fRefs[i] < mappings.length)
|
||||
map= mappings[fRefs[i]];
|
||||
if (map != -1 && map != 0)
|
||||
fRefs[position++]= map;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue