Skip to content

Commit b0801c9

Browse files
committed
QL: Add some missing qldoc
1 parent 8188e28 commit b0801c9

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

ql/ql/src/codeql_ql/dataflow/DataFlow.qll

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
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+
111
private import codeql_ql.ast.Ast
212
private import internal.NodesInternal
313
private import internal.DataFlowNumbering
@@ -15,8 +25,10 @@ private import internal.GlobalFlow as GlobalFlow
1525
* To reason about global data flow, use `SuperNode.track()`.
1626
*/
1727
class Node extends TNode {
28+
/** Gets a string representation of this element. */
1829
string toString() { none() } // overridden in subclasses
1930

31+
/** Gets the location of element. */
2032
Location getLocation() { none() } // overridden in subclasses
2133

2234
/**
@@ -158,8 +170,10 @@ class FieldNode extends Node, MkFieldNode {
158170
/** Gets the member predicate or charpred for which this node represents access to the field. */
159171
Predicate getPredicate() { result = pred }
160172

173+
/** Gets the declaration of the field. */
161174
FieldDecl getFieldDeclaration() { result = fieldDecl }
162175

176+
/** Gets the name of the field. */
163177
string getFieldName() { result = fieldDecl.getName() }
164178

165179
override string toString() { result = "'" + this.getFieldName() + "' in " + pred.getName() }

ql/ql/src/codeql_ql/dataflow/internal/VarScoping.qll

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1+
/**
2+
* Computes scopes in which it is safe to unify all uses of a given variable.
3+
*
4+
* It is not accurate to unify variables across a disjunction, so the scope of a variable
5+
* is restricted to its nearest enclosing disjunction operand ("disjunct").
6+
* At such a disjunct, we introduce a "refinement" of the variable, which is seen as a
7+
* redefinition of the variable within that disjunct.
8+
*
9+
* In principle this should also be done for `this`, `result`, and local field variables
10+
* but currently it is not.
11+
*/
12+
113
private import codeql_ql.ast.Ast
214
private import codeql_ql.ast.internal.AstNodeNumbering
315

0 commit comments

Comments
 (0)