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;
|
const int level = (pos1 - 1) / 2;
|
||||||
if (level == 0 || tree.empty())
|
if (level == 0 || level > tree.size())
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
AstNodePtr newNode = std::make_shared<AstNode>(nodeType, ext, &data);
|
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();
|
type = type->next();
|
||||||
}
|
}
|
||||||
if (type->str() == "(" && type->previous()->function())
|
if (type && type->str() == "(" && type->previous()->function())
|
||||||
// we are past the end of the type
|
// we are past the end of the type
|
||||||
type = type->previous();
|
type = type->previous();
|
||||||
continue;
|
continue;
|
||||||
|
|
Loading…
Reference in New Issue