mirror of
https://github.com/github/codeql.git
synced 2026-04-30 19:26:02 +02:00
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:
@@ -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)
|
||||
|
||||
@@ -1 +1 @@
|
||||
| 1189 |
|
||||
| 1185 |
|
||||
|
||||
Reference in New Issue
Block a user