forked from OSchip/llvm-project
[pseudo] Fix an invalid assertion on recoveryBrackets.
The `Begin` is not the index of the left bracket, `Begin-1` is, otherwise the assertion will be triggered on case `Foo().call();`.
This commit is contained in:
parent
ce824078de
commit
65c8e24622
|
@ -124,7 +124,7 @@ Token::Index recoverBrackets(Token::Index Begin, const TokenStream &Tokens) {
|
|||
assert(Left.Kind == tok::l_brace || Left.Kind == tok::l_paren ||
|
||||
Left.Kind == tok::l_square);
|
||||
if (const Token *Right = Left.pair()) {
|
||||
assert(Tokens.index(*Right) > Begin);
|
||||
assert(Tokens.index(*Right) > Begin - 1);
|
||||
return Tokens.index(*Right);
|
||||
}
|
||||
return Token::Invalid;
|
||||
|
|
Loading…
Reference in New Issue