File tree Expand file tree Collapse file tree
python/ql/test/library-tests/PointsTo/regressions/missing/if-urlsplit-access Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ | test.py:5:7:5:9 | ControlFlowNode for foo | int 42 |
2+ | test.py:11:11:11:13 | ControlFlowNode for foo | int 1 |
3+ | test.py:17:11:17:13 | ControlFlowNode for foo | <MISSING pointsTo()> |
Original file line number Diff line number Diff line change 1+ import python
2+
3+ from NameNode name , CallNode call , string debug
4+ where
5+ call .getAnArg ( ) = name and
6+ call .getFunction ( ) .( NameNode ) .getId ( ) = "check" and
7+ if exists ( name .pointsTo ( ) )
8+ then debug = name .pointsTo ( ) .toString ( )
9+ else debug = "<MISSING pointsTo()>"
10+ select name , debug
Original file line number Diff line number Diff line change 1+ semmle-extractor-options: --max-import-depth=1 --lang=3
Original file line number Diff line number Diff line change 1+ # Only a problem in Python 3
2+ from urllib .parse import urlsplit
3+
4+ foo = 42
5+ check (foo )
6+
7+ def func (url ):
8+ parts = urlsplit (url )
9+
10+ foo = 1
11+ check (foo )
12+
13+ if parts .path : # using `urlsplit(url).path` here is equivalent
14+ return # using `pass` here instead makes points-to work
15+
16+ foo = 2
17+ check (foo ) # no points-to information
You can’t perform that action at this time.
0 commit comments