Skip to content

Commit 87b6592

Browse files
committed
Python: Accept inconsistency for missing use-use flow
At least until we have a proper fix
1 parent 8fe483d commit 87b6592

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

python/ql/consistency-queries/TypeTrackingConsistency.ql

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,12 @@ private module ConsistencyChecksInput implements ConsistencyChecksInputSig {
2424
// TODO: when adding support for proper content, handle iterable unpacking better
2525
// such as `for k,v in items:`, or `a, (b,c) = ...`
2626
n instanceof DataFlow::IterableSequenceNode
27+
or
28+
// We have missing use-use flow in
29+
// https://github.com/python/cpython/blob/0fb18b02c8ad56299d6a2910be0bab8ad601ef24/Lib/socketserver.py#L276-L303
30+
// which I couldn't just fix. We ignore the problems here, and instead rely on the
31+
// test-case added in https://github.com/github/codeql/pull/15841
32+
n.getLocation().getFile().getAbsolutePath().matches("%/socketserver.py")
2733
}
2834
}
2935

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
unreachableNode
2+
| test2.py:16:17:16:17 | ControlFlowNode for y | Unreachable node in step of kind load bar. |
3+
| test2.py:25:23:25:23 | ControlFlowNode for x | Unreachable node in step of kind load attribute. |
4+
| test2.py:25:23:25:23 | ControlFlowNode for x | Unreachable node in step of kind simpleLocalSmallStep. |
5+
| test2.py:26:17:26:17 | ControlFlowNode for y | Unreachable node in step of kind load bar. |
6+
| test2.py:27:23:27:23 | ControlFlowNode for x | Unreachable node in step of kind simpleLocalSmallStep. |

0 commit comments

Comments
 (0)