Files
codeql/python/ql/test/library-tests/ControlFlow/PointsToSupport/UseFromDefinition.ql
2019-06-12 14:31:21 +01:00

17 lines
469 B
Plaintext

import python
/*Find any Definition, assigned value pairs that 'valueForDefinition' misses */
Expr assignedValue(Name n) {
exists(Assign a | a.getATarget() = n and result = a.getValue())
or
exists(Alias a | a.getAsname() = n and result = a.getValue())
}
from Name def, DefinitionNode d
where d = def.getAFlowNode() and
exists(assignedValue(def)) and
not d.getValue().getNode() = assignedValue(def)
select def.toString(), assignedValue(def)