1
+ /**
2
+ * Experimental library for reasoning about data flow.
3
+ *
4
+ * Current limitations:
5
+ * - Global flow does not reason about subclassing, overriding, and dispatch
6
+ * - `this`, `result`, and local field variables are treated less precisely
7
+ * than regular variables (see VarScoping.qll)
8
+ * - Polarity is not tracked, that is, global flow does not care about negation at all.
9
+ */
10
+
1
11
private import codeql_ql.ast.Ast
2
12
private import internal.NodesInternal
3
13
private import internal.DataFlowNumbering
@@ -15,8 +25,10 @@ private import internal.GlobalFlow as GlobalFlow
15
25
* To reason about global data flow, use `SuperNode.track()`.
16
26
*/
17
27
class Node extends TNode {
28
+ /** Gets a string representation of this element. */
18
29
string toString ( ) { none ( ) } // overridden in subclasses
19
30
31
+ /** Gets the location of element. */
20
32
Location getLocation ( ) { none ( ) } // overridden in subclasses
21
33
22
34
/**
@@ -158,8 +170,10 @@ class FieldNode extends Node, MkFieldNode {
158
170
/** Gets the member predicate or charpred for which this node represents access to the field. */
159
171
Predicate getPredicate ( ) { result = pred }
160
172
173
+ /** Gets the declaration of the field. */
161
174
FieldDecl getFieldDeclaration ( ) { result = fieldDecl }
162
175
176
+ /** Gets the name of the field. */
163
177
string getFieldName ( ) { result = fieldDecl .getName ( ) }
164
178
165
179
override string toString ( ) { result = "'" + this .getFieldName ( ) + "' in " + pred .getName ( ) }
0 commit comments