Skip to content

Commit c016b66

Browse files
committed
python: add qldoc
1 parent 0a6a7ec commit c016b66

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

python/ql/lib/semmle/python/dataflow/new/internal/DataFlowPublic.qll

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -615,6 +615,12 @@ private module WithParam<ParamSig P> {
615615
signature predicate guardChecksSig(GuardNode g, ControlFlowNode node, boolean branch, P param);
616616
}
617617

618+
/**
619+
* Provides a set of barrier nodes for a guard that validates a node.
620+
*
621+
* This is expected to be used in `isBarrier`/`isSanitizer` definitions
622+
* in data flow and taint tracking.
623+
*/
618624
module ParameterizedBarrierGuard<ParamSig P, WithParam<P>::guardChecksSig/4 guardChecks> {
619625
/** Gets a node that is safely guarded by the given guard check with parameter `param`. */
620626
ExprNode getABarrierNode(P param) {
@@ -627,10 +633,16 @@ module ParameterizedBarrierGuard<ParamSig P, WithParam<P>::guardChecksSig/4 guar
627633
}
628634
}
629635

636+
/**
637+
* Provides a set of barrier nodes for a guard that validates a node as described by an external predicate.
638+
*
639+
* This is expected to be used in `isBarrier`/`isSanitizer` definitions
640+
* in data flow and taint tracking.
641+
*/
630642
module ExternalBarrierGuard {
631643
private import semmle.python.ApiGraphs
632644

633-
predicate guardCheck(GuardNode g, ControlFlowNode node, boolean branch, string kind) {
645+
private predicate guardCheck(GuardNode g, ControlFlowNode node, boolean branch, string kind) {
634646
exists(API::CallNode call, API::Node parameter |
635647
parameter = call.getAParameter() and
636648
parameter = ModelOutput::getABarrierGuardNode(kind, branch)

0 commit comments

Comments
 (0)