mirror of
https://github.com/github/codeql.git
synced 2026-04-29 02:35:15 +02:00
Ruby: simplify Hash#transform_keys! flow summary
This commit is contained in:
@@ -474,9 +474,6 @@ private class TransformKeysBangSummary extends SimpleSummarizedCallable {
|
||||
(
|
||||
input = "Argument[self].Element[any]" and
|
||||
output = "Argument[self].Element[?]"
|
||||
or
|
||||
input = "Argument[self].WithoutElement[any]" and
|
||||
output = "Argument[self]"
|
||||
) and
|
||||
preservesValue = true
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -628,19 +628,21 @@ end
|
||||
|
||||
m38()
|
||||
|
||||
def m39()
|
||||
def m39(x)
|
||||
hash = {
|
||||
:a => taint(39.1),
|
||||
:b => 1,
|
||||
:c => taint(39.2)
|
||||
}
|
||||
hash[x] = taint(39.3)
|
||||
|
||||
hash.transform_keys! {|key| key.to_s }
|
||||
sink (hash["a"]) # $ hasValueFlow=39.1 $ hasValueFlow=39.2
|
||||
sink (hash["b"]) # $ hasValueFlow=39.1 $ hasValueFlow=39.2
|
||||
sink (hash["c"]) # $ hasValueFlow=39.1 $ hasValueFlow=39.2
|
||||
sink (hash["a"]) # $ hasValueFlow=39.1 $ hasValueFlow=39.2 $ hasValueFlow=39.3
|
||||
sink (hash["b"]) # $ hasValueFlow=39.1 $ hasValueFlow=39.2 $ hasValueFlow=39.3
|
||||
sink (hash["c"]) # $ hasValueFlow=39.1 $ hasValueFlow=39.2 $ hasValueFlow=39.3
|
||||
end
|
||||
|
||||
m39()
|
||||
m39(:d)
|
||||
|
||||
def m40()
|
||||
hash = {
|
||||
|
||||
Reference in New Issue
Block a user