Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkus Schorn2010-01-04 16:31:32 +0000
committerMarkus Schorn2010-01-04 16:31:32 +0000
commita867009329cb5fc94f60d65860c573d3163b89d4 (patch)
treee62b118f89db774fc0ee0194671a2b367ca42a3f /core/org.eclipse.cdt.core.tests
parent30bddf9ac04076b1900908e858d04352ffef2b62 (diff)
downloadorg.eclipse.cdt-a867009329cb5fc94f60d65860c573d3163b89d4.tar.gz
org.eclipse.cdt-a867009329cb5fc94f60d65860c573d3163b89d4.tar.xz
org.eclipse.cdt-a867009329cb5fc94f60d65860c573d3163b89d4.zip
Bug 298455: Stack overflow with deeply nested else if statements.
Diffstat (limited to 'core/org.eclipse.cdt.core.tests')
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2Tests.java14
1 files changed, 14 insertions, 0 deletions
diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2Tests.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2Tests.java
index e8c9b3218f2..c01a6ee36f4 100644
--- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2Tests.java
+++ b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2Tests.java
@@ -7221,4 +7221,18 @@ public class AST2Tests extends AST2BaseTest {
IASTTranslationUnit tu = parseAndCheckBindings(code, lang);
}
}
+
+ public void testDeepElseif_298455() throws Exception {
+ sValidateCopy= false;
+ StringBuilder buf= new StringBuilder("void f() {if (0) {}");
+ for (int i = 0; i < 75000; i++) {
+ buf.append("else if (0) {}");
+ }
+ buf.append("}");
+ String code= buf.toString();
+ for(ParserLanguage lang : ParserLanguage.values()) {
+ IASTTranslationUnit tu = parseAndCheckBindings(code, lang);
+ }
+ }
+
}

Back to the top