From 3098d1679b375f5aade47509f0090aa400396058 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 67845ea338f..8ed48d4c021 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 @@ -2674,6 +2674,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) { @@ -2686,7 +2689,7 @@ public abstract class AbstractGNUSourceCodeParser implements ISourceCodeParser { continue; } - if (lt1 == IToken.tEOC || lt1 == terminator) + if (lt1 == terminator) throwBacktrack(LA(1)); consume();