Fix inline suppression.
This commit is contained in:
parent
d45e4287e6
commit
c75a2265c0
|
@ -360,6 +360,14 @@ bool CheckUninitVar::checkScopeForVariable(const Token *tok, const Variable& var
|
|||
bool alwaysTrue = false;
|
||||
bool alwaysFalse = false;
|
||||
|
||||
// Is variable assigned in condition?
|
||||
if (!membervar.empty()) {
|
||||
for (const Token *cond = tok->linkAt(1); cond != tok; cond = cond->previous()) {
|
||||
if (cond->varId() == var.declarationId() && isMemberVariableAssignment(cond, membervar))
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
conditionAlwaysTrueOrFalse(tok->next()->astOperand2(), variableValue, &alwaysTrue, &alwaysFalse);
|
||||
|
||||
// initialization / usage in condition..
|
||||
|
|
|
@ -213,7 +213,6 @@ void CTU::FileInfo::loadFromXml(const tinyxml2::XMLElement *xmlElement)
|
|||
if (std::strcmp(e->Name(), "function-call") == 0) {
|
||||
FunctionCall functionCall;
|
||||
if (functionCall.loadFromXml(e))
|
||||
// cppcheck-suppress uninitStructMember // FP
|
||||
functionCalls.push_back(functionCall);
|
||||
} else if (std::strcmp(e->Name(), "nested-call") == 0) {
|
||||
NestedCall nestedCall;
|
||||
|
|
Loading…
Reference in New Issue