Fix Cppcheck self check warning

This commit is contained in:
Daniel Marjamäki 2021-01-09 11:14:41 +01:00
parent 35a42cd0fe
commit f6c98a0999
1 changed files with 2 additions and 0 deletions

View File

@ -389,6 +389,8 @@ std::string clangimport::AstNode::getSpelling() const
if (nodeType == DeclRefExpr) {
while (typeIndex > 0 && std::isalpha(mExtTokens[typeIndex][0]))
typeIndex--;
if (typeIndex <= 0)
return "";
}
const std::string &str = mExtTokens[typeIndex - 1];
if (str.compare(0,4,"col:") == 0)