fix daca crash in openfst fst_test.cc (#3095)

This commit is contained in:
IOBYTE 2021-01-30 00:33:09 -05:00 committed by GitHub
parent f17d5b719a
commit 7700cff0e9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 5 deletions

View File

@ -5099,16 +5099,21 @@ const Function* SymbolDatabase::findFunction(const Token *tok) const
}
if (currScope) {
while (currScope && !(Token::Match(tok1, "%type% :: %name% [(),>]") ||
(Token::Match(tok1, "%type% <") && Token::Match(tok1->linkAt(1), "> :: %name% (")))) {
while (currScope && tok1 && !(Token::Match(tok1, "%type% :: %name% [(),>]") ||
(Token::Match(tok1, "%type% <") && Token::Match(tok1->linkAt(1), "> :: %name% (")))) {
if (tok1->strAt(1) == "::")
tok1 = tok1->tokAt(2);
else
else if (tok1->strAt(1) == "<")
tok1 = tok1->linkAt(1)->tokAt(2);
currScope = currScope->findRecordInNestedList(tok1->str());
else
tok1 = nullptr;
if (tok1)
currScope = currScope->findRecordInNestedList(tok1->str());
}
tok1 = tok1->tokAt(2);
if (tok1)
tok1 = tok1->tokAt(2);
if (currScope && tok1)
return currScope->findFunction(tok1);