parent
0b9e823fc8
commit
1a25d3f9ec
|
@ -2226,7 +2226,9 @@ static bool valueFlowForward(Token * const startToken,
|
||||||
setTokenValue(tokChanged, v, settings);
|
setTokenValue(tokChanged, v, settings);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
values.remove_if([&](const ValueFlow::Value& v) { return v.indirect == i; });
|
values.remove_if([&](const ValueFlow::Value& v) {
|
||||||
|
return v.indirect == i;
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (values.empty()) {
|
if (values.empty()) {
|
||||||
|
@ -2751,7 +2753,9 @@ static bool valueFlowForward(Token * const startToken,
|
||||||
for (int i:getIndirections(values)) {
|
for (int i:getIndirections(values)) {
|
||||||
bool inconclusive = false;
|
bool inconclusive = false;
|
||||||
if (isVariableChangedByFunctionCall(tok2, i, settings, &inconclusive)) {
|
if (isVariableChangedByFunctionCall(tok2, i, settings, &inconclusive)) {
|
||||||
values.remove_if([&](const ValueFlow::Value& v) { return v.indirect <= i; });
|
values.remove_if([&](const ValueFlow::Value& v) {
|
||||||
|
return v.indirect <= i;
|
||||||
|
});
|
||||||
}
|
}
|
||||||
if (inconclusive) {
|
if (inconclusive) {
|
||||||
for (ValueFlow::Value &v : values) {
|
for (ValueFlow::Value &v : values) {
|
||||||
|
@ -2780,7 +2784,9 @@ static bool valueFlowForward(Token * const startToken,
|
||||||
for (int i:getIndirections(values)) {
|
for (int i:getIndirections(values)) {
|
||||||
// Remove unintialized values if modified
|
// Remove unintialized values if modified
|
||||||
if (isVariableChanged(tok2, i, settings, tokenlist->isCPP()))
|
if (isVariableChanged(tok2, i, settings, tokenlist->isCPP()))
|
||||||
values.remove_if([&](const ValueFlow::Value& v) { return v.isUninitValue() && v.indirect <= i; });
|
values.remove_if([&](const ValueFlow::Value& v) {
|
||||||
|
return v.isUninitValue() && v.indirect <= i;
|
||||||
|
});
|
||||||
}
|
}
|
||||||
} else if (isAliasOf(var, tok2, varid, values) && isVariableChanged(tok2, 0, settings, tokenlist->isCPP())) {
|
} else if (isAliasOf(var, tok2, varid, values) && isVariableChanged(tok2, 0, settings, tokenlist->isCPP())) {
|
||||||
if (settings->debugwarnings)
|
if (settings->debugwarnings)
|
||||||
|
|
Loading…
Reference in New Issue