Merge pull request #1691 from markshannon/python-fewer-missing-edges

Python: Make a few more expressions point-to the 'unknown' value.
This commit is contained in:
Taus
2019-08-12 16:15:09 +02:00
committed by GitHub
2 changed files with 11 additions and 1 deletions

View File

@@ -1396,6 +1396,14 @@ module Expressions {
)
}
pragma [noinline]
private boolean comparesToUnknown(CompareNode comp, PointsToContext context, ControlFlowNode operand, ObjectInternal opvalue) {
(comp.operands(operand, _, _) or comp.operands(_, _, operand)) and
PointsToInternal::pointsTo(operand, context, opvalue, _) and
opvalue = ObjectInternal::unknown() and
result = maybe()
}
pragma [noinline]
private predicate equalityTest(CompareNode comp, PointsToContext context, ControlFlowNode operand, ObjectInternal opvalue, ObjectInternal other, boolean sense) {
exists(ControlFlowNode r |
@@ -1526,6 +1534,8 @@ module Expressions {
or
result = containsComparisonEvaluatesTo(expr, context, subexpr, subvalue)
or
result = comparesToUnknown(expr, context, subexpr, subvalue)
or
result = isinstanceEvaluatesTo(expr, context, subexpr, subvalue)
or
result = issubclassEvaluatesTo(expr, context, subexpr, subvalue)

View File

@@ -1 +1 @@
| 1189 |
| 1185 |