Fixed crash on invalid code (#5603)
This commit is contained in:
parent
6a5617e552
commit
1be7bfa7fe
|
@ -81,7 +81,7 @@ SymbolDatabase::SymbolDatabase(const Tokenizer *tokenizer, const Settings *setti
|
||||||
tok2->linkAt(2)->next()->str() == ";")
|
tok2->linkAt(2)->next()->str() == ";")
|
||||||
tok = tok2->linkAt(2)->next();
|
tok = tok2->linkAt(2)->next();
|
||||||
else if (Token::Match(tok2->next(), "(|{") &&
|
else if (Token::Match(tok2->next(), "(|{") &&
|
||||||
tok2->next()->link()->next()->str() == ";")
|
tok2->next()->link()->strAt(1) == ";")
|
||||||
tok = tok2->next()->link()->next();
|
tok = tok2->next()->link()->next();
|
||||||
else
|
else
|
||||||
break; // bail
|
break; // bail
|
||||||
|
|
|
@ -1844,9 +1844,15 @@ private:
|
||||||
}
|
}
|
||||||
|
|
||||||
void garbage() {
|
void garbage() {
|
||||||
|
{
|
||||||
GET_SYMBOL_DB("void f( { u = 1 ; } ) { }");
|
GET_SYMBOL_DB("void f( { u = 1 ; } ) { }");
|
||||||
(void)db;
|
(void)db;
|
||||||
}
|
}
|
||||||
|
{
|
||||||
|
GET_SYMBOL_DB("{ }; void namespace A::f; { g() { int } }");
|
||||||
|
(void)db;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void findFunction1() {
|
void findFunction1() {
|
||||||
GET_SYMBOL_DB("int foo(int x);\n" /* 1 */
|
GET_SYMBOL_DB("int foo(int x);\n" /* 1 */
|
||||||
|
|
Loading…
Reference in New Issue