mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-06 09:16:02 +02:00
Bug 393029. Fixed stack overflow.
This commit is contained in:
parent
97974585ef
commit
926a7f5052
1 changed files with 5 additions and 4 deletions
|
@ -276,10 +276,11 @@ public class ASTCommenter {
|
|||
}
|
||||
|
||||
private static <T extends IASTNode> T getNextNodeInTu(Iterator<T> iter) {
|
||||
if (!iter.hasNext()) {
|
||||
return null;
|
||||
while (iter.hasNext()) {
|
||||
T next = iter.next();
|
||||
if (next.isPartOfTranslationUnitFile())
|
||||
return next;
|
||||
}
|
||||
T next = iter.next();
|
||||
return next.isPartOfTranslationUnitFile() ? next : getNextNodeInTu(iter);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue