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 11import experimental.dataflow.DataFlow
22
33/**
4- * A configuration to find " all" flows.
5- * To be used on small programs.
4+ * A configuration to find all flows.
5+ * To be used on tiny programs.
66 */
77class AllFlowsConfig extends DataFlow:: Configuration {
88 AllFlowsConfig ( ) { this = "AllFlowsConfig" }
99
10- override predicate isSource ( DataFlow:: Node node ) {
11- // node.asCfgNode().isEntryNode()
12- node instanceof DataFlow:: ParameterNode
13- or
14- node = DataFlow:: TEssaNode ( _) and
15- not exists ( DataFlow:: Node pred |
16- pred = DataFlow:: TEssaNode ( _) and
17- DataFlow:: localFlowStep ( pred , node )
18- )
19- }
10+ override predicate isSource ( DataFlow:: Node node ) { any ( ) }
2011
21- override predicate isSink ( DataFlow:: Node node ) {
22- node instanceof DataFlow:: ReturnNode
23- or
24- node = DataFlow:: TEssaNode ( _) and
25- not exists ( node .asEssaNode ( ) .getASourceUse ( ) )
26- }
12+ override predicate isSink ( DataFlow:: Node node ) { any ( ) }
2713}
Original file line number Diff line number Diff line change 1- | test.py:0:0:0:0 | GSSA Variable __name__ | test.py:0:0:0:0 | GSSA Variable __name__ |
2- | test.py:0:0:0:0 | GSSA Variable __package__ | test.py:0:0:0:0 | GSSA Variable __package__ |
3- | test.py:0:0:0:0 | GSSA Variable b | test.py:0:0:0:0 | GSSA Variable b |
4- | test.py:0:0:0:0 | SSA variable $ | test.py:0:0:0:0 | SSA variable $ |
5- | test.py:7:1:7:1 | GSSA Variable b | test.py:7:1:7:1 | GSSA Variable b |
1+ | test.py:1:19:1:19 | SSA variable x | test.py:1:1:1:21 | Exit node for Function obfuscated_id |
2+ | test.py:1:19:1:19 | SSA variable x | test.py:2:7:2:7 | ControlFlowNode for x |
3+ | test.py:4:10:4:10 | ControlFlowNode for z | test.py:7:5:7:20 | ControlFlowNode for obfuscated_id() |
4+ | test.py:7:19:7:19 | ControlFlowNode for a | test.py:1:1:1:21 | Exit node for Function obfuscated_id |
5+ | test.py:7:19:7:19 | ControlFlowNode for a | test.py:1:19:1:19 | SSA variable x |
6+ | test.py:7:19:7:19 | ControlFlowNode for a | test.py:2:7:2:7 | ControlFlowNode for x |
Original file line number Diff line number Diff line change 44 DataFlow:: Node source ,
55 DataFlow:: Node sink
66where
7+ source != sink and
78 exists ( AllFlowsConfig cfg | cfg .hasFlow ( source , sink ) )
89select
910 source , sink
Original file line number Diff line number Diff line change 1+ | test.py:1:19:1:19 | SSA variable x : DataFlowType | test.py:1:1:1:21 | Exit node for Function obfuscated_id |
2+ | test.py:1:19:1:19 | SSA variable x : DataFlowType | test.py:1:1:1:21 | Exit node for Function obfuscated_id |
3+ | test.py:1:19:1:19 | SSA variable x : DataFlowType | test.py:1:1:1:21 | Exit node for Function obfuscated_id : DataFlowType |
4+ | test.py:1:19:1:19 | SSA variable x : DataFlowType | test.py:1:1:1:21 | Exit node for Function obfuscated_id : DataFlowType |
5+ | test.py:1:19:1:19 | SSA variable x : DataFlowType | test.py:2:7:2:7 | ControlFlowNode for x |
6+ | test.py:1:19:1:19 | SSA variable x : DataFlowType | test.py:2:7:2:7 | ControlFlowNode for x |
7+ | test.py:1:19:1:19 | SSA variable x : DataFlowType | test.py:2:7:2:7 | ControlFlowNode for x : DataFlowType |
8+ | test.py:1:19:1:19 | SSA variable x : DataFlowType | test.py:2:7:2:7 | ControlFlowNode for x : DataFlowType |
9+ | test.py:4:10:4:10 | ControlFlowNode for z : DataFlowType | test.py:7:5:7:20 | ControlFlowNode for obfuscated_id() |
10+ | test.py:4:10:4:10 | ControlFlowNode for z : DataFlowType | test.py:7:5:7:20 | ControlFlowNode for obfuscated_id() : DataFlowType |
11+ | test.py:7:19:7:19 | ControlFlowNode for a : DataFlowType | test.py:1:19:1:19 | SSA variable x |
12+ | test.py:7:19:7:19 | ControlFlowNode for a : DataFlowType | test.py:1:19:1:19 | SSA variable x : DataFlowType |
You can’t perform that action at this time.
0 commit comments