1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-07 09:46: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) { private static <T extends IASTNode> T getNextNodeInTu(Iterator<T> iter) {
if (!iter.hasNext()) { while (iter.hasNext()) {
return null; T next = iter.next();
if (next.isPartOfTranslationUnitFile())
return next;
} }
T next = iter.next(); return null;
return next.isPartOfTranslationUnitFile() ? next : getNextNodeInTu(iter);
} }
} }