1
0
Fork 0
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:
Sergey Prigogin 2012-10-29 12:25:43 +01:00
parent 97974585ef
commit 926a7f5052

View file

@ -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;
}
}