• Erik Verbruggen's avatar
    C++: block recursion when parsing subsequent case statements. · 5d45e0b6
    Erik Verbruggen authored
    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: default avatarNikolai Kosjar <nikolai.kosjar@digia.com>
Parser.h 15.5 KB