Skip to content

Commit bf1ad23

Browse files
committed
Python: add comments
- on debug predicates - on JS implementation
1 parent c88d686 commit bf1ad23

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@ private import DataFlowPublic
55
private import semmle.python.dataflow.new.internal.DataFlowPrivate
66
private import codeql.dataflow.VariableCapture as Shared
77

8+
// Note: The Javascript implementation (on the branch https://github.com/github/codeql/pull/14412)
9+
// had some tweaks related to performance. See these two commits:
10+
// - JS: Capture flow: https://github.com/github/codeql/pull/14412/commits/7bcf8b858babfea0a3e36ce61145954c249e13ac
11+
// - JS: Disallow consecutive captured contents: https://github.com/github/codeql/pull/14412/commits/46e4cdc6232604ea7f58138a336d5a222fad8567
12+
// The first is the main implementation, the second is a performance motivated restriction.
813
private module CaptureInput implements Shared::InputSig<Location> {
914
private import python as PY
1015

@@ -142,6 +147,9 @@ predicate valueStep(Node nodeFrom, Node nodeTo) {
142147
/**
143148
* Provides predicates to understand the behaviour of the variable capture
144149
* library instantiation on Python code bases.
150+
*
151+
* The predicates in here are meant to be run by quick-eval on databases of
152+
* interest. The `unmapped*`-predicates should ideally be empty.
145153
*/
146154
private module Debug {
147155
predicate flowStoreStep(

0 commit comments

Comments
 (0)