Skip to content

Commit 62f0c64

Browse files
authored
Merge pull request github#12552 from erik-krogh/py-type-trackers
Py: refactor regex tracking to type-trackers
2 parents 61b0514 + 18f8c69 commit 62f0c64

34 files changed

+2335
-2632
lines changed

config/identical-files.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@
4747
"python/ql/lib/semmle/python/dataflow/new/internal/DataFlowImpl2.qll",
4848
"python/ql/lib/semmle/python/dataflow/new/internal/DataFlowImpl3.qll",
4949
"python/ql/lib/semmle/python/dataflow/new/internal/DataFlowImpl4.qll",
50-
"python/ql/lib/semmle/python/dataflow/new/internal/DataFlowImplForRegExp.qll",
5150
"ruby/ql/lib/codeql/ruby/dataflow/internal/DataFlowImpl1.qll",
5251
"ruby/ql/lib/codeql/ruby/dataflow/internal/DataFlowImpl2.qll",
5352
"ruby/ql/lib/codeql/ruby/dataflow/internal/DataFlowImplForHttpClientLibraries.qll",

python/ql/lib/semmle/python/Concepts.qll

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -421,6 +421,24 @@ module RegexExecution {
421421
}
422422
}
423423

424+
/**
425+
* A node where a string is interpreted as a regular expression,
426+
* for instance an argument to `re.compile`.
427+
*
428+
* Extend this class to refine existing API models. If you want to model new APIs,
429+
* extend `RegExpInterpretation::Range` instead.
430+
*/
431+
class RegExpInterpretation extends DataFlow::Node instanceof RegExpInterpretation::Range { }
432+
433+
/** Provides a class for modeling regular expression interpretations. */
434+
module RegExpInterpretation {
435+
/**
436+
* A node where a string is interpreted as a regular expression,
437+
* for instance an argument to `re.compile`.
438+
*/
439+
abstract class Range extends DataFlow::Node { }
440+
}
441+
424442
/** Provides classes for modeling XML-related APIs. */
425443
module XML {
426444
/**

python/ql/lib/semmle/python/PrintAst.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*/
88

99
import python
10-
import semmle.python.RegexTreeView
10+
import semmle.python.regexp.RegexTreeView
1111
import semmle.python.Yaml
1212

1313
private newtype TPrintAstConfiguration = MkPrintAstConfiguration()

0 commit comments

Comments
 (0)