From ef148a9ec5784c75858e73a77e261094c7e99ba4 Mon Sep 17 00:00:00 2001 From: Sergey Prigogin Date: Wed, 28 Oct 2015 18:01:03 -0700 Subject: [PATCH] Bug 472950 - Fixed an infinite loop in content assist inside a body of a lambda. Change-Id: I5194571ba8a88e67e9cc897be463c5e833700000 --- .../core/dom/parser/AbstractGNUSourceCodeParser.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/AbstractGNUSourceCodeParser.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/AbstractGNUSourceCodeParser.java index c8b85da97ee..b80bc3b2cd3 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/AbstractGNUSourceCodeParser.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/AbstractGNUSourceCodeParser.java @@ -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();