Bug 472950 - Fixed an infinite loop in content assist inside a body of a
authorSergey Prigogin <eclipse.sprigogin@gmail.com>
Thu, 29 Oct 2015 01:01:03 +0000 (18:01 -0700)
committerSergey Prigogin <eclipse.sprigogin@gmail.com>
Fri, 30 Oct 2015 23:29:06 +0000 (16:29 -0700)
lambda.

Change-Id: I5194571ba8a88e67e9cc897be463c5e833700000

core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/AbstractGNUSourceCodeParser.java

index c8b85da..b80bc3b 100644 (file)
@@ -2669,6 +2669,9 @@ public abstract class AbstractGNUSourceCodeParser implements ISourceCodeParser {
                while (true) {
                        final int lt1= LT(1);
 
+                       if (lt1 == IToken.tEOC)
+                               throwBacktrack(LA(1));
+
                        // Ignore passages inside braces (such as for a statement-expression),
                        // as they can basically contain tokens of any kind.
                        if (lt1 == IToken.tLBRACE) {
@@ -2681,7 +2684,7 @@ public abstract class AbstractGNUSourceCodeParser implements ISourceCodeParser {
                                continue;
                        }
 
-                       if (lt1 == IToken.tEOC || lt1 == terminator)
+                       if (lt1 == terminator)
                                throwBacktrack(LA(1));
 
                        consume();