mirror of
https://github.com/github/codeql.git
synced 2026-05-01 03:35:13 +02:00
Python points-to: Fix up tuple inequality analysis.
This commit is contained in:
@@ -1343,9 +1343,9 @@ module Expressions {
|
||||
or
|
||||
n = other.length() and n = val.length() and result = 0
|
||||
or
|
||||
result != 0 and result = compare_unbound(val.getItem(n), val.getItem(n))
|
||||
result != 0 and result = compare_unbound(val.getItem(n), other.getItem(n))
|
||||
or
|
||||
compare_unbound(val.getItem(n), val.getItem(n)) = 0 and result = compare_sequence(val, other, n+1)
|
||||
compare_unbound(val.getItem(n), other.getItem(n)) = 0 and result = compare_sequence(val, other, n+1)
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ import semmle.python.pointsto.PointsToContext
|
||||
|
||||
from ControlFlowNode f, Location l, Context c
|
||||
|
||||
where not PointsTo::Test::reachableBlock(f.getBasicBlock(), c) and c.isImport() and
|
||||
where not PointsToInternal::reachableBlock(f.getBasicBlock(), c) and c.isImport() and
|
||||
(f.getNode() instanceof FunctionExpr or f.getNode() instanceof ClassExpr) and
|
||||
l = f.getLocation() and l.getFile().getName().matches("%test.py")
|
||||
select l.getStartLine()
|
||||
@@ -1,3 +0,0 @@
|
||||
| module.py | 6 | BasicBlock | true |
|
||||
| test.py | 27 | BasicBlock | true |
|
||||
| test.py | 41 | BasicBlock | true |
|
||||
@@ -1,8 +0,0 @@
|
||||
|
||||
import python
|
||||
import semmle.python.types.Version
|
||||
|
||||
from VersionGuard vg, Location l, boolean b
|
||||
where l = vg.getLastNode().getLocation()
|
||||
and (if vg.isTrue() then b = true else b = false)
|
||||
select l.getFile().getName(), l.getStartLine(), vg.toString(), b
|
||||
Reference in New Issue
Block a user