mirror of
https://github.com/github/codeql.git
synced 2026-05-01 11:45:14 +02:00
Python: Use AttrRead/AttrWrite for attr read/store steps
Note that this doesn't actually add the desired flow from setattr, due to missing post-update note. This will be fixed in later commit.
This commit is contained in:
@@ -95,7 +95,7 @@ def test_direct_if_always_assign(cond = True):
|
||||
def test_getattr():
|
||||
myobj = MyObj(NONSOURCE)
|
||||
myobj.foo = SOURCE
|
||||
SINK(getattr(myobj, "foo")) # $ MISSING: flow
|
||||
SINK(getattr(myobj, "foo")) # $ flow="SOURCE, l:-1 -> getattr(..)"
|
||||
|
||||
|
||||
def test_setattr():
|
||||
@@ -110,6 +110,13 @@ def test_setattr_getattr():
|
||||
SINK(getattr(myobj, "foo")) # $ MISSING: flow
|
||||
|
||||
|
||||
def test_setattr_getattr_overwrite():
|
||||
myobj = MyObj(NONSOURCE)
|
||||
setattr(myobj, "foo", SOURCE)
|
||||
setattr(myobj, "foo", NONSOURCE)
|
||||
SINK_F(getattr(myobj, "foo"))
|
||||
|
||||
|
||||
def test_constructor_assign():
|
||||
obj = MyObj(SOURCE)
|
||||
SINK(obj.foo) # $ flow="SOURCE, l:-1 -> obj.foo"
|
||||
|
||||
Reference in New Issue
Block a user