File tree Expand file tree Collapse file tree
python/ql/test/experimental/dataflow Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ | test.py:0:0:0:0 | GSSA Variable __name__ | test.py:7:1:7:1 | GSSA Variable b |
2+ | test.py:0:0:0:0 | GSSA Variable __package__ | test.py:7:1:7:1 | GSSA Variable b |
3+ | test.py:0:0:0:0 | GSSA Variable b | test.py:7:1:7:1 | GSSA Variable b |
4+ | test.py:1:5:1:17 | GSSA Variable obfuscated_id | test.py:7:1:7:1 | GSSA Variable b |
5+ | test.py:1:19:1:19 | SSA variable x | test.py:4:10:4:10 | ControlFlowNode for z |
6+ | test.py:1:19:1:19 | SSA variable x | test.py:7:1:7:1 | GSSA Variable b |
7+ | test.py:2:3:2:3 | SSA variable y | test.py:4:10:4:10 | ControlFlowNode for z |
8+ | test.py:2:3:2:3 | SSA variable y | test.py:7:1:7:1 | GSSA Variable b |
9+ | test.py:3:3:3:3 | SSA variable z | test.py:4:10:4:10 | ControlFlowNode for z |
10+ | test.py:3:3:3:3 | SSA variable z | test.py:7:1:7:1 | GSSA Variable b |
11+ | test.py:6:1:6:1 | GSSA Variable a | test.py:4:10:4:10 | ControlFlowNode for z |
12+ | test.py:6:1:6:1 | GSSA Variable a | test.py:7:1:7:1 | GSSA Variable b |
13+ | test.py:6:1:6:1 | GSSA Variable a | test.py:7:5:7:20 | GSSA Variable a |
Original file line number Diff line number Diff line change 1+ import maximalFlowsConfig
2+
3+ from
4+ DataFlow:: Node source ,
5+ DataFlow:: Node sink
6+ where
7+ source != sink and
8+ exists ( MaximalFlowsConfig cfg | cfg .hasFlow ( source , sink ) )
9+ select
10+ source , sink
Original file line number Diff line number Diff line change 1+ import experimental.dataflow.DataFlow
2+
3+ /**
4+ * A configuration to find all "maximal" flows.
5+ * To be used on small programs.
6+ */
7+ class MaximalFlowsConfig extends DataFlow:: Configuration {
8+ MaximalFlowsConfig ( ) { this = "AllFlowsConfig" }
9+
10+ override predicate isSource ( DataFlow:: Node node ) {
11+ node instanceof DataFlow:: ParameterNode
12+ or
13+ node = DataFlow:: TEssaNode ( _) and
14+ not exists ( DataFlow:: Node pred |
15+ pred = DataFlow:: TEssaNode ( _) and
16+ DataFlow:: localFlowStep ( pred , node )
17+ )
18+ }
19+
20+ override predicate isSink ( DataFlow:: Node node ) {
21+ node instanceof DataFlow:: ReturnNode
22+ or
23+ node = DataFlow:: TEssaNode ( _) and
24+ not exists ( node .asEssaNode ( ) .getASourceUse ( ) )
25+ }
26+ }
You can’t perform that action at this time.
0 commit comments