Avoid duplicates in the error path (#1346)
This commit is contained in:
parent
43233e72b2
commit
fd49112196
|
@ -218,7 +218,10 @@ static void followVariableExpressionError(const Token *tok1, const Token *tok2,
|
||||||
return;
|
return;
|
||||||
if (!tok2)
|
if (!tok2)
|
||||||
return;
|
return;
|
||||||
errors->push_back(std::make_pair(tok2, "'" + tok1->str() + "' is assigned value '" + tok2->expressionString() + "' here."));
|
ErrorPathItem item = std::make_pair(tok2, "'" + tok1->str() + "' is assigned value '" + tok2->expressionString() + "' here.");
|
||||||
|
if(std::find(errors->begin(), errors->end(), item) != errors->end())
|
||||||
|
return;
|
||||||
|
errors->push_back(item);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool isSameExpression(bool cpp, bool macro, const Token *tok1, const Token *tok2, const Library& library, bool pure, ErrorPath* errors)
|
bool isSameExpression(bool cpp, bool macro, const Token *tok1, const Token *tok2, const Library& library, bool pure, ErrorPath* errors)
|
||||||
|
|
Loading…
Reference in New Issue