mirror of
https://github.com/github/codeql.git
synced 2026-04-04 22:58:16 +02:00
Python: Update CopySummary to use getMaDRepresentation
Demonstrates the somewhat more ergonomic way to use `getMaDRepresentation` when specifying summaries. Note that this slightly extends the previous definition, in that `DictionaryContentAny` is now _also_ propagated by a call to the `.copy()` method, but I think this is correct.
This commit is contained in:
@@ -4537,21 +4537,9 @@ module StdlibPrivate {
|
||||
override DataFlow::ArgumentNode getACallback() { none() }
|
||||
|
||||
override predicate propagatesFlow(string input, string output, boolean preservesValue) {
|
||||
exists(string content |
|
||||
content = "ListElement"
|
||||
or
|
||||
content = "SetElement"
|
||||
or
|
||||
exists(DataFlow::TupleElementContent tc, int i | i = tc.getIndex() |
|
||||
content = "TupleElement[" + i.toString() + "]"
|
||||
)
|
||||
or
|
||||
exists(DataFlow::DictionaryElementContent dc, string key | key = dc.getKey() |
|
||||
content = "DictionaryElement[" + key + "]"
|
||||
)
|
||||
|
|
||||
input = "Argument[self]." + content and
|
||||
output = "ReturnValue." + content and
|
||||
exists(DataFlow::Content c |
|
||||
input = "Argument[self]." + c.getMaDRepresentation() and
|
||||
output = "ReturnValue." + c.getMaDRepresentation() and
|
||||
preservesValue = true
|
||||
)
|
||||
or
|
||||
|
||||
Reference in New Issue
Block a user