Fixed #6885 (valueflow ignores assignment of variable via function call)
This commit is contained in:
parent
1f43550688
commit
bf75ee9aed
|
@ -1381,8 +1381,10 @@ static bool valueFlowForward(Token * const startToken,
|
||||||
}
|
}
|
||||||
if (inconclusive) {
|
if (inconclusive) {
|
||||||
std::list<ValueFlow::Value>::iterator it;
|
std::list<ValueFlow::Value>::iterator it;
|
||||||
for (it = values.begin(); it != values.end(); ++it)
|
for (it = values.begin(); it != values.end(); ++it) {
|
||||||
it->inconclusive = true;
|
it->inconclusive = true;
|
||||||
|
it->changeKnownToPossible();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1618,6 +1618,13 @@ private:
|
||||||
ASSERT_EQUALS(9, value.intvalue);
|
ASSERT_EQUALS(9, value.intvalue);
|
||||||
ASSERT(value.isPossible());
|
ASSERT(value.isPossible());
|
||||||
|
|
||||||
|
code = "void f() {\n"
|
||||||
|
" int x = 0;\n"
|
||||||
|
" fred.dostuff(x);\n"
|
||||||
|
" if (x < 0) {}\n"
|
||||||
|
"}\n";
|
||||||
|
ASSERT(isNotKnownValues(code, "<"));
|
||||||
|
|
||||||
code = "void f() {\n"
|
code = "void f() {\n"
|
||||||
" int x = 0;\n"
|
" int x = 0;\n"
|
||||||
" if (y) { dostuff(x); }\n"
|
" if (y) { dostuff(x); }\n"
|
||||||
|
|
Loading…
Reference in New Issue