Remove old pointer alias check (#3983)
This commit is contained in:
parent
52b4aeb279
commit
4c1aeb0cb1
|
@ -5248,14 +5248,7 @@ static void valueFlowAfterAssign(TokenList *tokenlist, SymbolDatabase* symboldat
|
|||
{
|
||||
for (const Scope * scope : symboldatabase->functionScopes) {
|
||||
std::unordered_map<nonneg int, std::unordered_set<nonneg int>> backAssigns;
|
||||
std::set<nonneg int> aliased;
|
||||
for (Token* tok = const_cast<Token*>(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<const Variable*> vars = getLHSVariables(tok);
|
||||
|
||||
// Rhs values..
|
||||
|
|
|
@ -305,6 +305,7 @@ void validCode()
|
|||
wordInit = HIWORD(dwordInit);
|
||||
// cppcheck-suppress redundantAssignment
|
||||
byteInit = HIBYTE(wordInit);
|
||||
// cppcheck-suppress knownConditionTrueFalse
|
||||
if (byteInit) {}
|
||||
|
||||
bool boolVar;
|
||||
|
|
Loading…
Reference in New Issue