Fixed stack-overflow when parsing insanely nested compound statements.

Thanks to Clang's parser_overflow.cpp which has >16000 nested compound
statements to check exactly the same.

Change-Id: I2b604f8ceb01115d7fe950994e0677a081e99481
Reviewed-by: Christian Kamm <christian.d.kamm@nokia.com>
This commit is contained in:
Erik Verbruggen
2011-10-17 10:24:39 +02:00
parent 7e3d41da58
commit 29dff7221d
2 changed files with 9 additions and 1 deletions

View File

@@ -315,6 +315,7 @@ private:
bool _inObjCImplementationContext: 1;
bool _inExpressionStatement: 1;
int _expressionDepth;
int _statementDepth;
MemoryPool _expressionStatementTempPool;
std::map<unsigned, TemplateArgumentListEntry> _templateArgumentList;