mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-09 01:05:38 +02:00
Bug 324384: Content assist in invalid K&R parameter decl.
This commit is contained in:
parent
703afbd706
commit
77a4148807
2 changed files with 9 additions and 1 deletions
|
@ -267,4 +267,12 @@ public class BasicCompletionTest extends CompletionTestBase {
|
||||||
String[] expected= {"tint"};
|
String[] expected= {"tint"};
|
||||||
checkCompletion(code, false, expected);
|
checkCompletion(code, false, expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// void f(x) int y(
|
||||||
|
public void testIncompleteKnrFunction_Bug324384b() throws Exception {
|
||||||
|
// Content assist won't work here, just verify that we don't run out of memory
|
||||||
|
String code = getAboveComment();
|
||||||
|
String[] expected= {};
|
||||||
|
checkCompletion(code, false, expected);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1935,7 +1935,7 @@ public class GNUCSourceParser extends AbstractGNUSourceCodeParser {
|
||||||
IToken next=null;
|
IToken next=null;
|
||||||
while (LT(1) != IToken.tLBRACE) {
|
while (LT(1) != IToken.tLBRACE) {
|
||||||
next = consume();
|
next = consume();
|
||||||
if (next == previous) { // infinite loop detected
|
if (next == previous || next.getType() == IToken.tEOC) { // infinite loop detected
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
previous = next;
|
previous = next;
|
||||||
|
|
Loading…
Add table
Reference in a new issue