ClangImport: If typeIndex is negative we want to have Cppcheck warnings about that

This commit is contained in:
Daniel Marjamäki 2021-01-10 14:51:28 +01:00
parent f493ce16b3
commit 4e07a13feb
1 changed files with 1 additions and 1 deletions

View File

@ -392,7 +392,7 @@ std::string clangimport::AstNode::getSpelling() const
if (typeIndex <= 0)
return "";
}
const std::string &str = mExtTokens[std::max(typeIndex - 1, 0)];
const std::string &str = mExtTokens[typeIndex - 1];
if (str.compare(0,4,"col:") == 0)
return "";
if (str.compare(0,8,"<invalid") == 0)