mirror of
https://github.com/github/codeql.git
synced 2026-04-25 16:55:19 +02:00
Python: compact types in type models
This commit is contained in:
@@ -33,4 +33,7 @@ extensions:
|
||||
- ["foo.MS_Class", "foo", "Member[get_instance].ReturnValue"]
|
||||
- ["foo.MS_Class!", "foo", "Member[get_class].ReturnValue"]
|
||||
# Ideally this would be a consequence of the above line
|
||||
- ["foo.MS_Class", "foo", "Member[get_class].ReturnValue.Instance"]
|
||||
- ["foo.MS_Class", "foo", "Member[get_class].ReturnValue.Instance"]
|
||||
- ["foo.MS_Class", "foo.MS_Factory!", "Member[get_instance].ReturnValue"]
|
||||
- ["foo.MS_Class", "foo.MS_Factory", "Member[make].ReturnValue"]
|
||||
- ["foo.MS_Class", "foo.Impl.MS_Class_Impl", ""]
|
||||
|
||||
@@ -33,4 +33,7 @@ extensions:
|
||||
- ["foo.MS_Class", "foo", "Member[get_instance].ReturnValue"]
|
||||
- ["foo.MS_Class!", "foo", "Member[get_class].ReturnValue"]
|
||||
# Ideally this would be a consequence of the above line
|
||||
- ["foo.MS_Class", "foo", "Member[get_class].ReturnValue.Instance"]
|
||||
- ["foo.MS_Class", "foo", "Member[get_class].ReturnValue.Instance"]
|
||||
- ["foo.MS_Class", "foo.MS_Factory!", "Member[get_instance].ReturnValue"]
|
||||
- ["foo.MS_Class", "foo.MS_Factory", "Member[make].ReturnValue"]
|
||||
- ["foo.MS_Class", "foo.Impl.MS_Class_Impl", ""]
|
||||
|
||||
@@ -30,7 +30,7 @@ def SINK_F(x):
|
||||
ensure_tainted = ensure_not_tainted = print
|
||||
TAINTED_STRING = "TAINTED_STRING"
|
||||
|
||||
from foo import MS_identity, MS_apply_lambda, MS_reversed, MS_list_map, MS_append_to_list, MS_spread, MS_spread_all
|
||||
from foo import MS_identity, MS_apply_lambda, MS_reversed, MS_list_map, MS_append_to_list, MS_spread, MS_spread_all, Impl
|
||||
|
||||
# Simple summary
|
||||
via_identity = MS_identity(SOURCE)
|
||||
@@ -122,7 +122,7 @@ a, b = MS_spread_all(SOURCE)
|
||||
SINK(a) # $ flow="SOURCE, l:-1 -> a"
|
||||
SINK(b) # $ flow="SOURCE, l:-2 -> b"
|
||||
|
||||
from foo import MS_Class, MS_Class_transitive, get_instance, get_class
|
||||
from foo import MS_Class, MS_Class_transitive, get_instance, get_class, MS_Factory
|
||||
|
||||
# Class summaries
|
||||
class_via_positional = MS_Class(SOURCE)
|
||||
@@ -184,6 +184,14 @@ SINK(returned_class(SOURCE).config) # $ flow="SOURCE -> returned_class(..).conf
|
||||
|
||||
SINK(returned_class().instance_method(SOURCE)[1]) # $flow="SOURCE -> returned_class().instance_method(..)[1]"
|
||||
|
||||
fatory_instance = MS_Factory.get_instance()
|
||||
SINK(fatory_instance.instance_method(SOURCE)[1]) # $ flow="SOURCE -> fatory_instance.instance_method(..)[1]"
|
||||
|
||||
factory = MS_Factory()
|
||||
SINK(factory.make().instance_method(SOURCE)[1]) # $ flow="SOURCE -> factory.make().instance_method(..)[1]"
|
||||
|
||||
also_instance = Impl.MS_Class_Impl()
|
||||
SINK(also_instance.instance_method(SOURCE)[1]) # $ flow="SOURCE -> also_instance.instance_method(..)[1]"
|
||||
|
||||
# Modeled flow-summary is not value preserving
|
||||
from json import MS_loads as json_loads
|
||||
|
||||
Reference in New Issue
Block a user