Test for self-referring assignment.

This commit is contained in:
chriseth
2018-02-06 12:58:51 +01:00
parent 669b63ca5f
commit c0abddc9dc
2 changed files with 9 additions and 2 deletions
-2
View File
@@ -135,9 +135,7 @@ void DataFlowAnalyzer::handleAssignment(set<string> const& _variables, Expressio
string const& name = *_variables.begin();
// Expression has to be movable and cannot contain a reference
// to the variable that will be assigned to.
// TODO: Add a test for that
if (_value && movableChecker.movable() && !movableChecker.referencedVariables().count(name))
// TODO If _value is null, we could use zero.
m_value[name] = _value;
}