Clang import; Fixed segmentation fault
This commit is contained in:
parent
d024eb3ee0
commit
9d54303cfa
|
@ -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<AstNode>(nodeType, ext, &data);
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue