fix daca crash in openfst fst_test.cc (#3095)
This commit is contained in:
parent
f17d5b719a
commit
7700cff0e9
|
@ -5099,16 +5099,21 @@ const Function* SymbolDatabase::findFunction(const Token *tok) const
|
||||||
}
|
}
|
||||||
|
|
||||||
if (currScope) {
|
if (currScope) {
|
||||||
while (currScope && !(Token::Match(tok1, "%type% :: %name% [(),>]") ||
|
while (currScope && tok1 && !(Token::Match(tok1, "%type% :: %name% [(),>]") ||
|
||||||
(Token::Match(tok1, "%type% <") && Token::Match(tok1->linkAt(1), "> :: %name% (")))) {
|
(Token::Match(tok1, "%type% <") && Token::Match(tok1->linkAt(1), "> :: %name% (")))) {
|
||||||
if (tok1->strAt(1) == "::")
|
if (tok1->strAt(1) == "::")
|
||||||
tok1 = tok1->tokAt(2);
|
tok1 = tok1->tokAt(2);
|
||||||
else
|
else if (tok1->strAt(1) == "<")
|
||||||
tok1 = tok1->linkAt(1)->tokAt(2);
|
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)
|
if (currScope && tok1)
|
||||||
return currScope->findFunction(tok1);
|
return currScope->findFunction(tok1);
|
||||||
|
|
Loading…
Reference in New Issue