diff --git a/lib/clangimport.cpp b/lib/clangimport.cpp index 4cc12ebe7..a180b5887 100644 --- a/lib/clangimport.cpp +++ b/lib/clangimport.cpp @@ -1491,7 +1491,7 @@ void clangimport::parseClangAstDump(Tokenizer *tokenizer, std::istream &f) } const int level = (pos1 - 1) / 2; - if (level == 0 || tree.empty()) + if (level == 0 || level > tree.size()) continue; AstNodePtr newNode = std::make_shared(nodeType, ext, &data); diff --git a/lib/symboldatabase.cpp b/lib/symboldatabase.cpp index 974f83aac..9a3a549c0 100644 --- a/lib/symboldatabase.cpp +++ b/lib/symboldatabase.cpp @@ -5912,7 +5912,7 @@ static const Token * parsedecl(const Token *type, ValueType * const valuetype, V } type = type->next(); } - if (type->str() == "(" && type->previous()->function()) + if (type && type->str() == "(" && type->previous()->function()) // we are past the end of the type type = type->previous(); continue;