Python: Enclosing callable for synthetic arguments

This commit is contained in:
Rasmus Lerchedahl Petersen
2020-12-01 12:11:14 +01:00
parent a16d58dfc0
commit 0629d3e6e7
2 changed files with 21 additions and 3 deletions

View File

@@ -287,6 +287,13 @@ class PosOverflowNode extends Node, TPosOverflowNode {
override string toString() { result = "PosOverflowNode for " + call.getNode().toString() }
override DataFlowCallable getEnclosingCallable() {
exists(Node node |
node = TCfgNode(call) and
result = node.getEnclosingCallable()
)
}
override Location getLocation() { result = call.getLocation() }
}
@@ -301,6 +308,13 @@ class KwOverflowNode extends Node, TKwOverflowNode {
override string toString() { result = "KwOverflowNode for " + call.getNode().toString() }
override DataFlowCallable getEnclosingCallable() {
exists(Node node |
node = TCfgNode(call) and
result = node.getEnclosingCallable()
)
}
override Location getLocation() { result = call.getLocation() }
}
@@ -316,6 +330,13 @@ class KwUnpacked extends Node, TKwUnpacked {
override string toString() { result = "KwUnpacked " + name }
override DataFlowCallable getEnclosingCallable() {
exists(Node node |
node = TCfgNode(call) and
result = node.getEnclosingCallable()
)
}
override Location getLocation() { result = call.getLocation() }
}

View File

@@ -1,8 +1,5 @@
uniqueEnclosingCallable
| test.py:239:27:239:27 | ControlFlowNode for p | Node should have one enclosing callable but has 0. |
| test.py:245:5:245:22 | PosOverflowNode for overflowCallee() | Node should have one enclosing callable but has 0. |
| test.py:248:5:248:26 | KwOverflowNode for overflowCallee() | Node should have one enclosing callable but has 0. |
| test.py:251:5:251:33 | KwOverflowNode for overflowCallee() | Node should have one enclosing callable but has 0. |
uniqueType
uniqueNodeLocation
missingLocation