Skip to content

Commit 9e90206

Browse files
committed
Java/C++/C#: Elaborate qldoc.
1 parent 4550175 commit 9e90206

File tree

4 files changed

+42
-10
lines changed

4 files changed

+42
-10
lines changed

cpp/ql/src/semmle/code/cpp/dataflow/internal/DataFlowUtil.qll

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -332,10 +332,18 @@ VariableAccess getAnAccessToAssignedVariable(Expr assign) {
332332
)
333333
}
334334

335-
/** A guard that validates some expression. */
335+
/**
336+
* A guard that validates some expression.
337+
*
338+
* To use this in a configuration, extend the class and provide a
339+
* characteristic predicate precisely specifying the guard, and override
340+
* `checks` to specify what is being validated and in which branch.
341+
*
342+
* It is important that all extending classes in scope are disjoint.
343+
*/
336344
class BarrierGuard extends Expr {
337-
/** Holds if this guard validates `e` upon evaluating to `branch`. */
338-
abstract predicate checks(Expr e, boolean branch);
345+
/** NOT YET SUPPORTED. Holds if this guard validates `e` upon evaluating to `branch`. */
346+
abstract deprecated predicate checks(Expr e, boolean branch);
339347

340348
/** Gets a node guarded by this. */
341349
final Node getAGuardedNode() {

cpp/ql/src/semmle/code/cpp/ir/dataflow/internal/DataFlowUtil.qll

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -168,10 +168,18 @@ predicate localFlowStep(Node nodeFrom, Node nodeTo) {
168168
*/
169169
predicate localFlow(Node source, Node sink) { localFlowStep*(source, sink) }
170170

171-
/** A guard that validates some expression. */
171+
/**
172+
* A guard that validates some expression.
173+
*
174+
* To use this in a configuration, extend the class and provide a
175+
* characteristic predicate precisely specifying the guard, and override
176+
* `checks` to specify what is being validated and in which branch.
177+
*
178+
* It is important that all extending classes in scope are disjoint.
179+
*/
172180
class BarrierGuard extends IRGuardCondition {
173-
/** Holds if this guard validates `e` upon evaluating to `b`. */
174-
abstract predicate checks(Instruction e, boolean b);
181+
/** NOT YET SUPPORTED. Holds if this guard validates `e` upon evaluating to `b`. */
182+
abstract deprecated predicate checks(Instruction e, boolean b);
175183

176184
/** Gets a node guarded by this. */
177185
final Node getAGuardedNode() {

csharp/ql/src/semmle/code/csharp/dataflow/internal/DataFlowPublic.qll

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -164,10 +164,18 @@ abstract class NonLocalJumpNode extends Node {
164164
abstract Node getAJumpSuccessor(boolean preservesValue);
165165
}
166166

167-
/** A guard that validates some expression. */
167+
/**
168+
* A guard that validates some expression.
169+
*
170+
* To use this in a configuration, extend the class and provide a
171+
* characteristic predicate precisely specifying the guard, and override
172+
* `checks` to specify what is being validated and in which branch.
173+
*
174+
* It is important that all extending classes in scope are disjoint.
175+
*/
168176
class BarrierGuard extends Internal::Guard {
169-
/** Holds if this guard validates `e` upon evaluating to `v`. */
170-
abstract predicate checks(Expr e, AbstractValue v);
177+
/** NOT YET SUPPORTED. Holds if this guard validates `e` upon evaluating to `v`. */
178+
abstract deprecated predicate checks(Expr e, AbstractValue v);
171179

172180
/** Gets a node guarded by this. */
173181
final Node getAGuardedNode() {

java/ql/src/semmle/code/java/dataflow/internal/DataFlowUtil.qll

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,15 @@ Node getInstanceArgument(Call call) {
418418
implicitInstanceArgument(call, result.(ImplicitInstanceAccess).getInstanceAccess())
419419
}
420420

421-
/** A guard that validates some expression. */
421+
/**
422+
* A guard that validates some expression.
423+
*
424+
* To use this in a configuration, extend the class and provide a
425+
* characteristic predicate precisely specifying the guard, and override
426+
* `checks` to specify what is being validated and in which branch.
427+
*
428+
* It is important that all extending classes in scope are disjoint.
429+
*/
422430
class BarrierGuard extends Guard {
423431
/** Holds if this guard validates `e` upon evaluating to `branch`. */
424432
abstract predicate checks(Expr e, boolean branch);

0 commit comments

Comments
 (0)