mirror of
https://github.com/github/codeql.git
synced 2026-05-05 13:45:19 +02:00
Python: Add some more utility predicates and classes to the new 'Value' API.
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
| file://:0:0:0:0 | Builtin-function exit | exit |
|
||||
| file://:0:0:0:0 | Builtin-function len | len |
|
||||
| file://:0:0:0:0 | builtin method append | list.append |
|
||||
| test.py:8:1:8:10 | Function foo | foo |
|
||||
| test.py:13:5:13:19 | Function C.meth | C.meth |
|
||||
16
python/ql/test/library-tests/PointsTo/api/QualifedNames.ql
Normal file
16
python/ql/test/library-tests/PointsTo/api/QualifedNames.ql
Normal file
@@ -0,0 +1,16 @@
|
||||
|
||||
import python
|
||||
|
||||
from FunctionValue v, string name
|
||||
where name = v.getQualifiedName() and
|
||||
(
|
||||
v = Value::named("len")
|
||||
or
|
||||
v instanceof PythonFunctionValue
|
||||
or
|
||||
v = Value::named("sys.exit")
|
||||
or
|
||||
v = Value::named("list").(ClassValue).lookup("append")
|
||||
)
|
||||
|
||||
select v, name
|
||||
@@ -4,3 +4,11 @@ u"c"
|
||||
b"d"
|
||||
1000
|
||||
1004
|
||||
|
||||
def foo():
|
||||
pass
|
||||
|
||||
class C(object):
|
||||
|
||||
def meth(self):
|
||||
pass
|
||||
|
||||
Reference in New Issue
Block a user