Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 25d624d

Browse files
committed
Python: Implement parameter nodes
1 parent 8e51b2f commit 25d624d

1 file changed

Lines changed: 14 additions & 4 deletions

File tree

python/ql/src/experimental/dataflow/internal/DataFlowPrivate.qll

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,18 @@ class DataFlowCall extends CallNode {
8080
}
8181

8282
/** A data flow node that represents a call argument. */
83-
abstract class ArgumentNode extends Node {
83+
class ArgumentNode extends Node {
84+
ArgumentNode() {
85+
exists( DataFlowCall call, int pos |
86+
this.asCfgNode() = call.getArg(pos)
87+
)
88+
}
89+
8490
/** Holds if this argument occurs at the given position in the given call. */
8591
cached
86-
abstract predicate argumentOf(DataFlowCall call, int pos);
92+
predicate argumentOf(DataFlowCall call, int pos) {
93+
this.asCfgNode() = call.getArg(pos)
94+
}
8795

8896
/** Gets the call in which this node is an argument. */
8997
final DataFlowCall getCall() { this.argumentOf(result, _) }
@@ -111,9 +119,11 @@ class ReturnKind extends TReturnKind {
111119
}
112120

113121
/** A data flow node that represents a value returned by a callable. */
114-
abstract class ReturnNode extends Node {
122+
class ReturnNode extends Node {
123+
// ReturnNode() { this.asCfgNode() instanceof TODO }
124+
115125
/** Gets the kind of this return node. */
116-
abstract ReturnKind getKind();
126+
ReturnKind getKind() { result = TNormalReturnKind() }
117127
}
118128

119129
/** A data flow node that represents the output of a call. */

0 commit comments

Comments
 (0)