Moved function from .h to .cpp

This commit is contained in:
PKEuS 2019-12-21 11:54:47 +01:00
parent 077e652de4
commit 8218120fd5
2 changed files with 19 additions and 16 deletions

View File

@ -75,3 +75,21 @@ std::string Check::getMessageId(const ValueFlow::Value &value, const char id[])
return std::string("safe") + (char)std::toupper(id[0]) + (id + 1);
return id;
}
ErrorPath Check::getErrorPath(const Token* errtok, const ValueFlow::Value* value, const std::string& bug) const
{
ErrorPath errorPath;
if (!value) {
errorPath.emplace_back(errtok, bug);
} else if (mSettings->verbose || mSettings->xml || !mSettings->templateLocation.empty()) {
errorPath = value->errorPath;
errorPath.emplace_back(errtok, bug);
} else {
if (value->condition)
errorPath.emplace_back(value->condition, "condition '" + value->condition->expressionString() + "'");
//else if (!value->isKnown() || value->defaultArg)
// errorPath = value->callstack;
errorPath.emplace_back(errtok, bug);
}
return errorPath;
}

View File

@ -162,22 +162,7 @@ protected:
reportError(errmsg);
}
ErrorPath getErrorPath(const Token *errtok, const ValueFlow::Value *value, const std::string &bug) const {
ErrorPath errorPath;
if (!value) {
errorPath.emplace_back(errtok,bug);
} else if (mSettings->verbose || mSettings->xml || !mSettings->templateLocation.empty()) {
errorPath = value->errorPath;
errorPath.emplace_back(errtok,bug);
} else {
if (value->condition)
errorPath.emplace_back(value->condition, "condition '" + value->condition->expressionString() + "'");
//else if (!value->isKnown() || value->defaultArg)
// errorPath = value->callstack;
errorPath.emplace_back(errtok,bug);
}
return errorPath;
}
ErrorPath getErrorPath(const Token* errtok, const ValueFlow::Value* value, const std::string& bug) const;
/**
* Use WRONG_DATA in checkers when you check for wrong data. That