Skip to content

Commit 1649ec7

Browse files
committed
Python: Describe current naming scheme
In the hope that this will enable a better one. It looks like - type tracking should currently be mutually recursive with data flow (this needs investigation) - type tracking already supports special methods (we should probably have a test for this)
1 parent 5653780 commit 1649ec7

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

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

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,25 @@
11
/**
22
* Provides Python specific classes and predicates for defining flow summaries.
3+
*
4+
* Flow summaries are defined for callables that are not extracted.
5+
* Such callables go by different names in different parts of our codebase:
6+
*
7+
* - in `FlowSummary.qll`, which is user facing, they are called `SummarizedCallable`s.
8+
* These contain summaries, implemented by the user via the predicates `propagatesFlow` and `propagatesFlowExt`.
9+
*
10+
* - in the data flow layer, they are called `LibraryCallable`s (as in the Ruby codebase).
11+
* These are identified by strings and has predicates for finding calls to them.
12+
*
13+
* Having both extracted and non-extracted callables means that we now have three types of calls:
14+
* - Extracted calls to extracted callables, either `NonLibraryNormalCall` or `SpecialCall`. These are handled by standard data flow.
15+
* - Extracted calls to non-extracted callables, `LibraryCall`. These are handled by summaries.
16+
* - Non-extracted calls, `SummaryCall`. These are synthesised by the flow summary framework.
17+
*
18+
* The first two can be referred to as `DataFlowSourceCall`. They have been split up for the benefit of call resolutiuon.
19+
* Resolving a call to a non-extracted callable goes via `LibraryCallable::getACall`, which may involve type tracking.
20+
* To avoid that type tracking becomes mutualy recursive with data flow, type tracking must use a call graph not including summaries.
21+
*
22+
* We do not support summaries of special methods.
323
*/
424

525
private import python

0 commit comments

Comments
 (0)