diff --git a/lib/valueflow.cpp b/lib/valueflow.cpp index 27ca49126..2d852528a 100644 --- a/lib/valueflow.cpp +++ b/lib/valueflow.cpp @@ -5248,14 +5248,7 @@ static void valueFlowAfterAssign(TokenList *tokenlist, SymbolDatabase* symboldat { for (const Scope * scope : symboldatabase->functionScopes) { std::unordered_map> backAssigns; - std::set aliased; for (Token* tok = const_cast(scope->bodyStart); tok != scope->bodyEnd; tok = tok->next()) { - // Alias - if (tok->isUnaryOp("&")) { - aliased.insert(tok->astOperand1()->exprId()); - continue; - } - // Assignment if ((tok->str() != "=" && !isVariableInit(tok)) || (tok->astParent())) continue; @@ -5263,9 +5256,6 @@ static void valueFlowAfterAssign(TokenList *tokenlist, SymbolDatabase* symboldat // Lhs should be a variable if (!tok->astOperand1() || !tok->astOperand1()->exprId()) continue; - const nonneg int exprid = tok->astOperand1()->exprId(); - if (aliased.find(exprid) != aliased.end()) - continue; std::vector vars = getLHSVariables(tok); // Rhs values.. diff --git a/test/cfg/windows.cpp b/test/cfg/windows.cpp index 721893e67..db171ac83 100644 --- a/test/cfg/windows.cpp +++ b/test/cfg/windows.cpp @@ -305,6 +305,7 @@ void validCode() wordInit = HIWORD(dwordInit); // cppcheck-suppress redundantAssignment byteInit = HIBYTE(wordInit); + // cppcheck-suppress knownConditionTrueFalse if (byteInit) {} bool boolVar;