File tree Expand file tree Collapse file tree 1 file changed +18
-2
lines changed
cpp/ql/src/semmle/code/cpp/dataflow/internal Expand file tree Collapse file tree 1 file changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -84,8 +84,13 @@ cached class FlowVar extends TFlowVar {
8484 *
8585 * In contrast to a normal "definition", which provides a new value for
8686 * something, a partial definition is an expression that may affect a
87- * value, but does not necessarily replace it entirely. For example,
88- * `x.y = 1;` is a partial definition of the object `x`.
87+ * value, but does not necessarily replace it entirely. For example:
88+ * ```
89+ * x.y = 1; // a partial definition of the object `x`.
90+ * x.y.z = 1; // a partial definition of the objects `x` and `x.y`.
91+ * x.setY(1); // a partial definition of the object `x`.
92+ * setY(&x); // a partial definition of the object `x`.
93+ * ```
8994 */
9095private module PartialDefinitions {
9196 private newtype TPartialDefinition =
@@ -121,8 +126,19 @@ private module PartialDefinitions {
121126
122127 predicate partiallyDefinesThis ( ThisExpr e ) { definedExpr = e }
123128
129+ /**
130+ * Gets the subBasicBlock where this `PartialDefinition` is defined.
131+ */
124132 ControlFlowNode getSubBasicBlockStart ( ) { result = node }
125133
134+ /**
135+ * Gets the expression that is being partially defined. For example in the
136+ * following code:
137+ * ```
138+ * x.y = 1;
139+ * ```
140+ * The expression `x` is being partially defined.
141+ */
126142 Expr getDefinedExpr ( ) { result = definedExpr }
127143
128144 Location getLocation ( ) {
You can’t perform that action at this time.
0 commit comments