forked from qt-creator/qt-creator
		
	C++: block recursion when parsing subsequent case statements.
A case or a default statement must be followed by another statement. When a such a case (or default) statement is followed immediately by another case (or default) statement, then this would create a linked list, and the parser will recurse to parse such input. In order to prevent the parser running out of stack space while recursing, parse this corner case by blocking parsing a labeled statement as the first statement after a labeled statement. The advantage is that these statements do not form a linked list, so any subsequent visitation of the AST won't run out of stack space either. Change-Id: Id2111a49509132997f5fbe4bb12c92c729ec2522 Task-number: QTCREATORBUG-12673 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
This commit is contained in:
		
				
					committed by
					
						
						Nikolai Kosjar
					
				
			
			
				
	
			
			
			
						parent
						
							f51553b228
						
					
				
				
					commit
					5d45e0b69a
				
			
							
								
								
									
										2
									
								
								src/libs/3rdparty/cplusplus/Parser.h
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								src/libs/3rdparty/cplusplus/Parser.h
									
									
									
									
										vendored
									
									
								
							@@ -142,7 +142,7 @@ public:
 | 
			
		||||
    bool parsePtrOperator(PtrOperatorListAST *&node);
 | 
			
		||||
    bool parseRelationalExpression(ExpressionAST *&node);
 | 
			
		||||
    bool parseShiftExpression(ExpressionAST *&node);
 | 
			
		||||
    bool parseStatement(StatementAST *&node);
 | 
			
		||||
    bool parseStatement(StatementAST *&node, bool blockLabeledStatement = false);
 | 
			
		||||
    bool parseThisExpression(ExpressionAST *&node);
 | 
			
		||||
    bool parseBoolLiteral(ExpressionAST *&node);
 | 
			
		||||
    bool parseNumericLiteral(ExpressionAST *&node);
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user