Skip to content

Commit 43e7159

Browse files
Update vf_analyzers.cpp [skip ci]
1 parent 846b55c commit 43e7159

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

lib/vf_analyzers.cpp

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -209,9 +209,14 @@ struct ValueFlowAnalyzer : Analyzer {
209209
virtual Action isModified(const Token* tok) const {
210210
const ValueFlow::Value* value = getValue(tok);
211211
if (value) {
212-
// Moving a moved value won't change the moved value
213-
if (value->isMovedValue() && isMoveOrForward(tok) != ValueFlow::Value::MoveKind::NonMovedVariable)
214-
return Action::Read;
212+
if (value->isMovedValue()) {
213+
// Moving a moved value won't change the moved value
214+
if (isMoveOrForward(tok) != ValueFlow::Value::MoveKind::NonMovedVariable)
215+
return Action::Read;
216+
bool inconclusive = false;
217+
if (isVariableChangedByFunctionCall(tok, getIndirect(tok), getSettings(), &inconclusive) || inconclusive)
218+
return Action::Invalid;
219+
}
215220
// Inserting elements to container won't change the lifetime
216221
if (astIsContainer(tok) && value->isLifetimeValue() &&
217222
contains({Library::Container::Action::PUSH,

0 commit comments

Comments
 (0)