Fix Cppcheck self check warning
This commit is contained in:
parent
35a42cd0fe
commit
f6c98a0999
|
@ -389,6 +389,8 @@ std::string clangimport::AstNode::getSpelling() const
|
||||||
if (nodeType == DeclRefExpr) {
|
if (nodeType == DeclRefExpr) {
|
||||||
while (typeIndex > 0 && std::isalpha(mExtTokens[typeIndex][0]))
|
while (typeIndex > 0 && std::isalpha(mExtTokens[typeIndex][0]))
|
||||||
typeIndex--;
|
typeIndex--;
|
||||||
|
if (typeIndex <= 0)
|
||||||
|
return "";
|
||||||
}
|
}
|
||||||
const std::string &str = mExtTokens[typeIndex - 1];
|
const std::string &str = mExtTokens[typeIndex - 1];
|
||||||
if (str.compare(0,4,"col:") == 0)
|
if (str.compare(0,4,"col:") == 0)
|
||||||
|
|
Loading…
Reference in New Issue