mirror of
https://github.com/github/codeql.git
synced 2026-04-29 02:35:15 +02:00
Python: More precise dataflow for tuples
(and dictionaries, but that is not fleshed out)
This commit is contained in:
@@ -230,13 +230,35 @@ predicate storeStep(Node nodeFrom, Content c, Node nodeTo) {
|
||||
// `[..., 42, ...]`
|
||||
// nodeFrom is `42`, cfg node
|
||||
// nodeTo is the sequence, say `[..., 42, ...]`, cfg node
|
||||
nodeTo.(CfgNode).getNode().(SequenceNode).getAnElement() = nodeFrom.(CfgNode).getNode()
|
||||
//
|
||||
// List
|
||||
nodeTo.(CfgNode).getNode().(ListNode).getAnElement() = nodeFrom.(CfgNode).getNode() and
|
||||
c instanceof ListElementContent
|
||||
or
|
||||
// Tuple
|
||||
exists(int n |
|
||||
nodeTo.(CfgNode).getNode().(TupleNode).getNode().(Tuple).getElt(n) = nodeFrom.(CfgNode).getNode().getNode() and
|
||||
c.(TupleElementContent).getIndex() = n and
|
||||
nodeFrom.(CfgNode).getNode().(NameNode).getId() = "SOURCE"
|
||||
)
|
||||
or
|
||||
//
|
||||
// Comprehension
|
||||
// `[x+1 for x in l]`
|
||||
// nodeFrom is `x+1`, cfg node
|
||||
// nodeTo is `[x+1 for x in l]`, cfg node
|
||||
nodeTo.(CfgNode).getNode().getNode().(Comp).getElt() = nodeFrom.(CfgNode).getNode().getNode()
|
||||
//
|
||||
// List
|
||||
nodeTo.(CfgNode).getNode().getNode().(ListComp).getElt() = nodeFrom.(CfgNode).getNode().getNode() and
|
||||
c instanceof ListElementContent
|
||||
or
|
||||
// Set
|
||||
nodeTo.(CfgNode).getNode().getNode().(SetComp).getElt() = nodeFrom.(CfgNode).getNode().getNode() and
|
||||
c instanceof SetElementContent
|
||||
or
|
||||
// Dictionary
|
||||
nodeTo.(CfgNode).getNode().getNode().(DictComp).getElt() = nodeFrom.(CfgNode).getNode().getNode() and
|
||||
c instanceof DictionaryElementAnyContent
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -247,7 +269,18 @@ predicate readStep(Node nodeFrom, Content c, Node nodeTo) {
|
||||
// `l[3]`
|
||||
// nodeFrom is `l`, cfg node
|
||||
// nodeTo is `l[3]`, cfg node
|
||||
nodeFrom.(CfgNode).getNode() = nodeTo.(CfgNode).getNode().(SubscriptNode).getObject()
|
||||
nodeFrom.(CfgNode).getNode() = nodeTo.(CfgNode).getNode().(SubscriptNode).getObject() and
|
||||
(
|
||||
c instanceof ListElementContent
|
||||
or
|
||||
c instanceof SetElementContent
|
||||
or
|
||||
c instanceof DictionaryElementAnyContent
|
||||
or
|
||||
c.(TupleElementContent).getIndex() = nodeTo.(CfgNode).getNode().(SubscriptNode).getIndex().getNode().(IntegerLiteral).getValue()
|
||||
or
|
||||
c.(DictionaryElementContent).getKey() = nodeTo.(CfgNode).getNode().(SubscriptNode).getIndex().getNode().(StrConst).getS()
|
||||
)
|
||||
or
|
||||
// set.pop
|
||||
// `s.pop()`
|
||||
@@ -257,7 +290,12 @@ predicate readStep(Node nodeFrom, Content c, Node nodeTo) {
|
||||
call.getFunction() = a and
|
||||
a.getName() = "pop" and // TODO: Should be made more robust, like Value::named("set.pop").getACall()
|
||||
nodeFrom.(CfgNode).getNode() = a.getObject() and
|
||||
nodeTo.(CfgNode).getNode() = call
|
||||
nodeTo.(CfgNode).getNode() = call and
|
||||
(
|
||||
c instanceof ListElementContent
|
||||
or
|
||||
c instanceof SetElementContent
|
||||
)
|
||||
)
|
||||
or
|
||||
// Comprehension
|
||||
|
||||
@@ -145,6 +145,58 @@ class BarrierGuard extends Expr {
|
||||
/**
|
||||
* A reference contained in an object. This is either a field or a property.
|
||||
*/
|
||||
class Content extends string {
|
||||
Content() { this = "Content" }
|
||||
newtype TContent =
|
||||
/** An element of a list. */
|
||||
TListElementContent() or
|
||||
/** An element of a set. */
|
||||
TSetElementContent() or
|
||||
/** An element of a tuple at a specifik index. */
|
||||
TTupleElementContent(int index) { exists(IntegerLiteral lit | lit.getValue() = index) } or
|
||||
/** An element of a dictionary under a specific key. */
|
||||
TDictionaryElementContent(string key) { exists(StrConst s | s.getS() = key ) } or
|
||||
/** An element of a dictionary at any key. */
|
||||
TDictionaryElementAnyContent()
|
||||
|
||||
class Content extends TContent {
|
||||
/** Gets a textual representation of this element. */
|
||||
string toString() { result = "Content" }
|
||||
}
|
||||
|
||||
class ListElementContent extends TListElementContent, Content {
|
||||
/** Gets a textual representation of this element. */
|
||||
override string toString() { result = "List element" }
|
||||
}
|
||||
|
||||
class SetElementContent extends TSetElementContent, Content {
|
||||
/** Gets a textual representation of this element. */
|
||||
override string toString() { result = "Set element" }
|
||||
}
|
||||
|
||||
class TupleElementContent extends TTupleElementContent, Content {
|
||||
int index;
|
||||
|
||||
TupleElementContent() { this = TTupleElementContent(index) }
|
||||
|
||||
/** Gets the index for this tuple element */
|
||||
int getIndex() { result = index }
|
||||
|
||||
/** Gets a textual representation of this element. */
|
||||
override string toString() { result = "Tuple element at " + index.toString() }
|
||||
}
|
||||
|
||||
class DictionaryElementContent extends TDictionaryElementContent, Content {
|
||||
string key;
|
||||
|
||||
DictionaryElementContent() { this = TDictionaryElementContent(key) }
|
||||
|
||||
/** Gets the index for this tuple element */
|
||||
string getKey() { result = key }
|
||||
|
||||
/** Gets a textual representation of this element. */
|
||||
override string toString() { result = "Dictionary element at " + key }
|
||||
}
|
||||
|
||||
class DictionaryElementAnyContent extends TDictionaryElementAnyContent, Content {
|
||||
/** Gets a textual representation of this element. */
|
||||
override string toString() { result = "Any dictionary element" }
|
||||
}
|
||||
|
||||
@@ -1,57 +1,48 @@
|
||||
edges
|
||||
| test.py:24:10:24:26 | ControlFlowNode for Tuple [Content] | test.py:25:9:25:9 | ControlFlowNode for x [Content] |
|
||||
| test.py:24:21:24:26 | ControlFlowNode for SOURCE | test.py:24:10:24:26 | ControlFlowNode for Tuple [Content] |
|
||||
| test.py:25:9:25:9 | ControlFlowNode for x [Content] | test.py:25:9:25:12 | ControlFlowNode for Subscript |
|
||||
| test.py:24:10:24:26 | ControlFlowNode for Tuple [Tuple element at 1] | test.py:25:9:25:9 | ControlFlowNode for x [Tuple element at 1] |
|
||||
| test.py:24:21:24:26 | ControlFlowNode for SOURCE | test.py:24:10:24:26 | ControlFlowNode for Tuple [Tuple element at 1] |
|
||||
| test.py:25:9:25:9 | ControlFlowNode for x [Tuple element at 1] | test.py:25:9:25:12 | ControlFlowNode for Subscript |
|
||||
| test.py:25:9:25:12 | ControlFlowNode for Subscript | test.py:26:10:26:10 | ControlFlowNode for y |
|
||||
| test.py:29:10:29:26 | ControlFlowNode for Tuple [Content] | test.py:30:9:30:9 | ControlFlowNode for x [Content] |
|
||||
| test.py:29:21:29:26 | ControlFlowNode for SOURCE | test.py:29:10:29:26 | ControlFlowNode for Tuple [Content] |
|
||||
| test.py:30:9:30:9 | ControlFlowNode for x [Content] | test.py:30:9:30:12 | ControlFlowNode for Subscript |
|
||||
| test.py:30:9:30:12 | ControlFlowNode for Subscript | test.py:31:12:31:12 | ControlFlowNode for y |
|
||||
| test.py:35:9:35:14 | ControlFlowNode for SOURCE | test.py:36:10:36:10 | ControlFlowNode for x |
|
||||
| test.py:40:9:40:16 | ControlFlowNode for Str | test.py:41:10:41:10 | ControlFlowNode for x |
|
||||
| test.py:44:9:44:17 | ControlFlowNode for Str | test.py:45:10:45:10 | ControlFlowNode for x |
|
||||
| test.py:48:9:48:10 | ControlFlowNode for IntegerLiteral | test.py:49:10:49:10 | ControlFlowNode for x |
|
||||
| test.py:52:9:52:12 | ControlFlowNode for FloatLiteral | test.py:53:10:53:10 | ControlFlowNode for x |
|
||||
| test.py:61:10:61:15 | ControlFlowNode for SOURCE | test.py:62:10:62:10 | ControlFlowNode for x |
|
||||
| test.py:66:9:66:16 | ControlFlowNode for List [Content] | test.py:67:10:67:10 | ControlFlowNode for x [Content] |
|
||||
| test.py:66:10:66:15 | ControlFlowNode for SOURCE | test.py:66:9:66:16 | ControlFlowNode for List [Content] |
|
||||
| test.py:67:10:67:10 | ControlFlowNode for x [Content] | test.py:67:10:67:13 | ControlFlowNode for Subscript |
|
||||
| test.py:74:9:74:37 | ControlFlowNode for ListComp [Content] | test.py:75:10:75:10 | ControlFlowNode for x [Content] |
|
||||
| test.py:74:10:74:15 | ControlFlowNode for SOURCE | test.py:74:9:74:37 | ControlFlowNode for ListComp [Content] |
|
||||
| test.py:75:10:75:10 | ControlFlowNode for x [Content] | test.py:75:10:75:13 | ControlFlowNode for Subscript |
|
||||
| test.py:78:9:78:29 | ControlFlowNode for ListComp [Content] | test.py:79:10:79:10 | ControlFlowNode for x [Content] |
|
||||
| test.py:78:10:78:10 | ControlFlowNode for y | test.py:78:9:78:29 | ControlFlowNode for ListComp [Content] |
|
||||
| test.py:66:9:66:16 | ControlFlowNode for List [List element] | test.py:67:10:67:10 | ControlFlowNode for x [List element] |
|
||||
| test.py:66:10:66:15 | ControlFlowNode for SOURCE | test.py:66:9:66:16 | ControlFlowNode for List [List element] |
|
||||
| test.py:67:10:67:10 | ControlFlowNode for x [List element] | test.py:67:10:67:13 | ControlFlowNode for Subscript |
|
||||
| test.py:74:9:74:37 | ControlFlowNode for ListComp [List element] | test.py:75:10:75:10 | ControlFlowNode for x [List element] |
|
||||
| test.py:74:10:74:15 | ControlFlowNode for SOURCE | test.py:74:9:74:37 | ControlFlowNode for ListComp [List element] |
|
||||
| test.py:75:10:75:10 | ControlFlowNode for x [List element] | test.py:75:10:75:13 | ControlFlowNode for Subscript |
|
||||
| test.py:78:9:78:29 | ControlFlowNode for ListComp [List element] | test.py:79:10:79:10 | ControlFlowNode for x [List element] |
|
||||
| test.py:78:10:78:10 | ControlFlowNode for y | test.py:78:9:78:29 | ControlFlowNode for ListComp [List element] |
|
||||
| test.py:78:16:78:16 | SSA variable y | test.py:78:10:78:10 | ControlFlowNode for y |
|
||||
| test.py:78:21:78:28 | ControlFlowNode for List [Content] | test.py:78:16:78:16 | SSA variable y |
|
||||
| test.py:78:22:78:27 | ControlFlowNode for SOURCE | test.py:78:21:78:28 | ControlFlowNode for List [Content] |
|
||||
| test.py:79:10:79:10 | ControlFlowNode for x [Content] | test.py:79:10:79:13 | ControlFlowNode for Subscript |
|
||||
| test.py:91:9:91:37 | ControlFlowNode for SetComp [Content] | test.py:92:10:92:10 | ControlFlowNode for x [Content] |
|
||||
| test.py:91:10:91:15 | ControlFlowNode for SOURCE | test.py:91:9:91:37 | ControlFlowNode for SetComp [Content] |
|
||||
| test.py:92:10:92:10 | ControlFlowNode for x [Content] | test.py:92:10:92:16 | ControlFlowNode for Attribute() |
|
||||
| test.py:95:9:95:29 | ControlFlowNode for SetComp [Content] | test.py:96:10:96:10 | ControlFlowNode for x [Content] |
|
||||
| test.py:95:10:95:10 | ControlFlowNode for y | test.py:95:9:95:29 | ControlFlowNode for SetComp [Content] |
|
||||
| test.py:78:21:78:28 | ControlFlowNode for List [List element] | test.py:78:16:78:16 | SSA variable y |
|
||||
| test.py:78:22:78:27 | ControlFlowNode for SOURCE | test.py:78:21:78:28 | ControlFlowNode for List [List element] |
|
||||
| test.py:79:10:79:10 | ControlFlowNode for x [List element] | test.py:79:10:79:13 | ControlFlowNode for Subscript |
|
||||
| test.py:91:9:91:37 | ControlFlowNode for SetComp [Set element] | test.py:92:10:92:10 | ControlFlowNode for x [Set element] |
|
||||
| test.py:91:10:91:15 | ControlFlowNode for SOURCE | test.py:91:9:91:37 | ControlFlowNode for SetComp [Set element] |
|
||||
| test.py:92:10:92:10 | ControlFlowNode for x [Set element] | test.py:92:10:92:16 | ControlFlowNode for Attribute() |
|
||||
| test.py:95:9:95:29 | ControlFlowNode for SetComp [Set element] | test.py:96:10:96:10 | ControlFlowNode for x [Set element] |
|
||||
| test.py:95:10:95:10 | ControlFlowNode for y | test.py:95:9:95:29 | ControlFlowNode for SetComp [Set element] |
|
||||
| test.py:95:16:95:16 | SSA variable y | test.py:95:10:95:10 | ControlFlowNode for y |
|
||||
| test.py:95:21:95:28 | ControlFlowNode for List [Content] | test.py:95:16:95:16 | SSA variable y |
|
||||
| test.py:95:22:95:27 | ControlFlowNode for SOURCE | test.py:95:21:95:28 | ControlFlowNode for List [Content] |
|
||||
| test.py:96:10:96:10 | ControlFlowNode for x [Content] | test.py:96:10:96:16 | ControlFlowNode for Attribute() |
|
||||
| test.py:222:11:222:16 | ControlFlowNode for SOURCE | test.py:222:11:222:17 | ControlFlowNode for Tuple [Content] |
|
||||
| test.py:222:11:222:17 | ControlFlowNode for Tuple [Content] | test.py:222:10:222:21 | ControlFlowNode for Subscript |
|
||||
| test.py:225:10:225:17 | ControlFlowNode for List [Content] | test.py:225:10:225:20 | ControlFlowNode for Subscript |
|
||||
| test.py:225:11:225:16 | ControlFlowNode for SOURCE | test.py:225:10:225:17 | ControlFlowNode for List [Content] |
|
||||
| test.py:95:21:95:28 | ControlFlowNode for List [List element] | test.py:95:16:95:16 | SSA variable y |
|
||||
| test.py:95:22:95:27 | ControlFlowNode for SOURCE | test.py:95:21:95:28 | ControlFlowNode for List [List element] |
|
||||
| test.py:96:10:96:10 | ControlFlowNode for x [Set element] | test.py:96:10:96:16 | ControlFlowNode for Attribute() |
|
||||
| test.py:222:11:222:16 | ControlFlowNode for SOURCE | test.py:222:11:222:17 | ControlFlowNode for Tuple [Tuple element at 0] |
|
||||
| test.py:222:11:222:17 | ControlFlowNode for Tuple [Tuple element at 0] | test.py:222:10:222:21 | ControlFlowNode for Subscript |
|
||||
| test.py:225:10:225:17 | ControlFlowNode for List [List element] | test.py:225:10:225:20 | ControlFlowNode for Subscript |
|
||||
| test.py:225:11:225:16 | ControlFlowNode for SOURCE | test.py:225:10:225:17 | ControlFlowNode for List [List element] |
|
||||
| test.py:246:28:246:33 | ControlFlowNode for SOURCE | test.py:246:10:246:34 | ControlFlowNode for second() |
|
||||
| test.py:305:12:305:17 | ControlFlowNode for SOURCE | test.py:305:10:305:18 | ControlFlowNode for f() |
|
||||
| test.py:309:28:309:33 | ControlFlowNode for SOURCE | test.py:309:10:309:34 | ControlFlowNode for second() |
|
||||
nodes
|
||||
| test.py:24:10:24:26 | ControlFlowNode for Tuple [Content] | semmle.label | ControlFlowNode for Tuple [Content] |
|
||||
| test.py:24:10:24:26 | ControlFlowNode for Tuple [Tuple element at 1] | semmle.label | ControlFlowNode for Tuple [Tuple element at 1] |
|
||||
| test.py:24:21:24:26 | ControlFlowNode for SOURCE | semmle.label | ControlFlowNode for SOURCE |
|
||||
| test.py:25:9:25:9 | ControlFlowNode for x [Content] | semmle.label | ControlFlowNode for x [Content] |
|
||||
| test.py:25:9:25:9 | ControlFlowNode for x [Tuple element at 1] | semmle.label | ControlFlowNode for x [Tuple element at 1] |
|
||||
| test.py:25:9:25:12 | ControlFlowNode for Subscript | semmle.label | ControlFlowNode for Subscript |
|
||||
| test.py:26:10:26:10 | ControlFlowNode for y | semmle.label | ControlFlowNode for y |
|
||||
| test.py:29:10:29:26 | ControlFlowNode for Tuple [Content] | semmle.label | ControlFlowNode for Tuple [Content] |
|
||||
| test.py:29:21:29:26 | ControlFlowNode for SOURCE | semmle.label | ControlFlowNode for SOURCE |
|
||||
| test.py:30:9:30:9 | ControlFlowNode for x [Content] | semmle.label | ControlFlowNode for x [Content] |
|
||||
| test.py:30:9:30:12 | ControlFlowNode for Subscript | semmle.label | ControlFlowNode for Subscript |
|
||||
| test.py:31:12:31:12 | ControlFlowNode for y | semmle.label | ControlFlowNode for y |
|
||||
| test.py:35:9:35:14 | ControlFlowNode for SOURCE | semmle.label | ControlFlowNode for SOURCE |
|
||||
| test.py:36:10:36:10 | ControlFlowNode for x | semmle.label | ControlFlowNode for x |
|
||||
| test.py:40:9:40:16 | ControlFlowNode for Str | semmle.label | ControlFlowNode for Str |
|
||||
@@ -64,36 +55,36 @@ nodes
|
||||
| test.py:53:10:53:10 | ControlFlowNode for x | semmle.label | ControlFlowNode for x |
|
||||
| test.py:61:10:61:15 | ControlFlowNode for SOURCE | semmle.label | ControlFlowNode for SOURCE |
|
||||
| test.py:62:10:62:10 | ControlFlowNode for x | semmle.label | ControlFlowNode for x |
|
||||
| test.py:66:9:66:16 | ControlFlowNode for List [Content] | semmle.label | ControlFlowNode for List [Content] |
|
||||
| test.py:66:9:66:16 | ControlFlowNode for List [List element] | semmle.label | ControlFlowNode for List [List element] |
|
||||
| test.py:66:10:66:15 | ControlFlowNode for SOURCE | semmle.label | ControlFlowNode for SOURCE |
|
||||
| test.py:67:10:67:10 | ControlFlowNode for x [Content] | semmle.label | ControlFlowNode for x [Content] |
|
||||
| test.py:67:10:67:10 | ControlFlowNode for x [List element] | semmle.label | ControlFlowNode for x [List element] |
|
||||
| test.py:67:10:67:13 | ControlFlowNode for Subscript | semmle.label | ControlFlowNode for Subscript |
|
||||
| test.py:74:9:74:37 | ControlFlowNode for ListComp [Content] | semmle.label | ControlFlowNode for ListComp [Content] |
|
||||
| test.py:74:9:74:37 | ControlFlowNode for ListComp [List element] | semmle.label | ControlFlowNode for ListComp [List element] |
|
||||
| test.py:74:10:74:15 | ControlFlowNode for SOURCE | semmle.label | ControlFlowNode for SOURCE |
|
||||
| test.py:75:10:75:10 | ControlFlowNode for x [Content] | semmle.label | ControlFlowNode for x [Content] |
|
||||
| test.py:75:10:75:10 | ControlFlowNode for x [List element] | semmle.label | ControlFlowNode for x [List element] |
|
||||
| test.py:75:10:75:13 | ControlFlowNode for Subscript | semmle.label | ControlFlowNode for Subscript |
|
||||
| test.py:78:9:78:29 | ControlFlowNode for ListComp [Content] | semmle.label | ControlFlowNode for ListComp [Content] |
|
||||
| test.py:78:9:78:29 | ControlFlowNode for ListComp [List element] | semmle.label | ControlFlowNode for ListComp [List element] |
|
||||
| test.py:78:10:78:10 | ControlFlowNode for y | semmle.label | ControlFlowNode for y |
|
||||
| test.py:78:16:78:16 | SSA variable y | semmle.label | SSA variable y |
|
||||
| test.py:78:21:78:28 | ControlFlowNode for List [Content] | semmle.label | ControlFlowNode for List [Content] |
|
||||
| test.py:78:21:78:28 | ControlFlowNode for List [List element] | semmle.label | ControlFlowNode for List [List element] |
|
||||
| test.py:78:22:78:27 | ControlFlowNode for SOURCE | semmle.label | ControlFlowNode for SOURCE |
|
||||
| test.py:79:10:79:10 | ControlFlowNode for x [Content] | semmle.label | ControlFlowNode for x [Content] |
|
||||
| test.py:79:10:79:10 | ControlFlowNode for x [List element] | semmle.label | ControlFlowNode for x [List element] |
|
||||
| test.py:79:10:79:13 | ControlFlowNode for Subscript | semmle.label | ControlFlowNode for Subscript |
|
||||
| test.py:91:9:91:37 | ControlFlowNode for SetComp [Content] | semmle.label | ControlFlowNode for SetComp [Content] |
|
||||
| test.py:91:9:91:37 | ControlFlowNode for SetComp [Set element] | semmle.label | ControlFlowNode for SetComp [Set element] |
|
||||
| test.py:91:10:91:15 | ControlFlowNode for SOURCE | semmle.label | ControlFlowNode for SOURCE |
|
||||
| test.py:92:10:92:10 | ControlFlowNode for x [Content] | semmle.label | ControlFlowNode for x [Content] |
|
||||
| test.py:92:10:92:10 | ControlFlowNode for x [Set element] | semmle.label | ControlFlowNode for x [Set element] |
|
||||
| test.py:92:10:92:16 | ControlFlowNode for Attribute() | semmle.label | ControlFlowNode for Attribute() |
|
||||
| test.py:95:9:95:29 | ControlFlowNode for SetComp [Content] | semmle.label | ControlFlowNode for SetComp [Content] |
|
||||
| test.py:95:9:95:29 | ControlFlowNode for SetComp [Set element] | semmle.label | ControlFlowNode for SetComp [Set element] |
|
||||
| test.py:95:10:95:10 | ControlFlowNode for y | semmle.label | ControlFlowNode for y |
|
||||
| test.py:95:16:95:16 | SSA variable y | semmle.label | SSA variable y |
|
||||
| test.py:95:21:95:28 | ControlFlowNode for List [Content] | semmle.label | ControlFlowNode for List [Content] |
|
||||
| test.py:95:21:95:28 | ControlFlowNode for List [List element] | semmle.label | ControlFlowNode for List [List element] |
|
||||
| test.py:95:22:95:27 | ControlFlowNode for SOURCE | semmle.label | ControlFlowNode for SOURCE |
|
||||
| test.py:96:10:96:10 | ControlFlowNode for x [Content] | semmle.label | ControlFlowNode for x [Content] |
|
||||
| test.py:96:10:96:10 | ControlFlowNode for x [Set element] | semmle.label | ControlFlowNode for x [Set element] |
|
||||
| test.py:96:10:96:16 | ControlFlowNode for Attribute() | semmle.label | ControlFlowNode for Attribute() |
|
||||
| test.py:222:10:222:21 | ControlFlowNode for Subscript | semmle.label | ControlFlowNode for Subscript |
|
||||
| test.py:222:11:222:16 | ControlFlowNode for SOURCE | semmle.label | ControlFlowNode for SOURCE |
|
||||
| test.py:222:11:222:17 | ControlFlowNode for Tuple [Content] | semmle.label | ControlFlowNode for Tuple [Content] |
|
||||
| test.py:225:10:225:17 | ControlFlowNode for List [Content] | semmle.label | ControlFlowNode for List [Content] |
|
||||
| test.py:222:11:222:17 | ControlFlowNode for Tuple [Tuple element at 0] | semmle.label | ControlFlowNode for Tuple [Tuple element at 0] |
|
||||
| test.py:225:10:225:17 | ControlFlowNode for List [List element] | semmle.label | ControlFlowNode for List [List element] |
|
||||
| test.py:225:10:225:20 | ControlFlowNode for Subscript | semmle.label | ControlFlowNode for Subscript |
|
||||
| test.py:225:11:225:16 | ControlFlowNode for SOURCE | semmle.label | ControlFlowNode for SOURCE |
|
||||
| test.py:246:10:246:34 | ControlFlowNode for second() | semmle.label | ControlFlowNode for second() |
|
||||
@@ -104,7 +95,6 @@ nodes
|
||||
| test.py:309:28:309:33 | ControlFlowNode for SOURCE | semmle.label | ControlFlowNode for SOURCE |
|
||||
#select
|
||||
| test.py:26:10:26:10 | ControlFlowNode for y | test.py:24:21:24:26 | ControlFlowNode for SOURCE | test.py:26:10:26:10 | ControlFlowNode for y | <message> |
|
||||
| test.py:31:12:31:12 | ControlFlowNode for y | test.py:29:21:29:26 | ControlFlowNode for SOURCE | test.py:31:12:31:12 | ControlFlowNode for y | <message> |
|
||||
| test.py:36:10:36:10 | ControlFlowNode for x | test.py:35:9:35:14 | ControlFlowNode for SOURCE | test.py:36:10:36:10 | ControlFlowNode for x | <message> |
|
||||
| test.py:41:10:41:10 | ControlFlowNode for x | test.py:40:9:40:16 | ControlFlowNode for Str | test.py:41:10:41:10 | ControlFlowNode for x | <message> |
|
||||
| test.py:45:10:45:10 | ControlFlowNode for x | test.py:44:9:44:17 | ControlFlowNode for Str | test.py:45:10:45:10 | ControlFlowNode for x | <message> |
|
||||
|
||||
@@ -28,7 +28,7 @@ def test_tuple_with_local_flow():
|
||||
def test_tuple_negative():
|
||||
x = (NONSOURCE, SOURCE)
|
||||
y = x[0]
|
||||
SINK_F(y) # False positive
|
||||
SINK_F(y)
|
||||
|
||||
# 6.2.1. Identifiers (Names)
|
||||
def test_names():
|
||||
|
||||
Reference in New Issue
Block a user