Skip to content

Commit 8dd19ca

Browse files
committed
Python: Add example of re.compile missing points-to
1 parent 0da554c commit 8dd19ca

File tree

3 files changed

+16
-0
lines changed

3 files changed

+16
-0
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
| test.py:5:7:5:13 | ControlFlowNode for PATTERN | <MISSING pointsTo()> |
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
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
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import re
2+
3+
PATTERN = re.compile("a|b")
4+
5+
check(PATTERN)

0 commit comments

Comments
 (0)