Ruby: Fix Argument[any] in Hash.qll

With this PR, `self` have to be explicitly added. A few edges were
removed, and I don't know why. It doesn't seem to affect results, so I
did not worry too much.
This commit is contained in:
Rasmus Wriedt Larsen
2022-05-24 18:09:52 +02:00
parent 04ac466189
commit ae65af2c07
2 changed files with 4 additions and 8 deletions

View File

@@ -362,10 +362,10 @@ private class MergeSummary extends SimpleSummarizedCallable {
override predicate propagatesFlowExt(string input, string output, boolean preservesValue) {
(
input = "Argument[any].WithElement[any]" and
input = "Argument[self,any].WithElement[any]" and
output = "ReturnValue"
or
input = "Argument[any].Element[any]" and
input = "Argument[self,any].Element[any]" and
output = "Argument[block].Parameter[1,2]"
) and
preservesValue = true
@@ -377,10 +377,10 @@ private class MergeBangSummary extends SimpleSummarizedCallable {
override predicate propagatesFlowExt(string input, string output, boolean preservesValue) {
(
input = "Argument[any].WithElement[any]" and
input = "Argument[self,any].WithElement[any]" and
output = ["ReturnValue", "Argument[self]"]
or
input = "Argument[any].Element[any]" and
input = "Argument[self,any].Element[any]" and
output = "Argument[block].Parameter[1,2]"
) and
preservesValue = true

View File

@@ -248,9 +248,7 @@ edges
| hash_flow.rb:414:11:414:14 | hash [element :f] : | hash_flow.rb:414:11:414:18 | ...[...] : |
| hash_flow.rb:414:11:414:18 | ...[...] : | hash_flow.rb:414:10:414:19 | ( ... ) |
| hash_flow.rb:421:15:421:25 | call to taint : | hash_flow.rb:430:12:430:16 | hash1 [element :a] : |
| hash_flow.rb:421:15:421:25 | call to taint : | hash_flow.rb:442:11:442:15 | hash1 [element :a] : |
| hash_flow.rb:423:15:423:25 | call to taint : | hash_flow.rb:430:12:430:16 | hash1 [element :c] : |
| hash_flow.rb:423:15:423:25 | call to taint : | hash_flow.rb:444:11:444:15 | hash1 [element :c] : |
| hash_flow.rb:426:15:426:25 | call to taint : | hash_flow.rb:430:25:430:29 | hash2 [element :d] : |
| hash_flow.rb:428:15:428:25 | call to taint : | hash_flow.rb:430:25:430:29 | hash2 [element :f] : |
| hash_flow.rb:430:12:430:16 | [post] hash1 [element :a] : | hash_flow.rb:442:11:442:15 | hash1 [element :a] : |
@@ -444,9 +442,7 @@ edges
| hash_flow.rb:663:11:663:14 | hash [element] : | hash_flow.rb:663:11:663:18 | ...[...] : |
| hash_flow.rb:663:11:663:18 | ...[...] : | hash_flow.rb:663:10:663:19 | ( ... ) |
| hash_flow.rb:670:15:670:25 | call to taint : | hash_flow.rb:679:12:679:16 | hash1 [element :a] : |
| hash_flow.rb:670:15:670:25 | call to taint : | hash_flow.rb:691:11:691:15 | hash1 [element :a] : |
| hash_flow.rb:672:15:672:25 | call to taint : | hash_flow.rb:679:12:679:16 | hash1 [element :c] : |
| hash_flow.rb:672:15:672:25 | call to taint : | hash_flow.rb:693:11:693:15 | hash1 [element :c] : |
| hash_flow.rb:675:15:675:25 | call to taint : | hash_flow.rb:679:25:679:29 | hash2 [element :d] : |
| hash_flow.rb:677:15:677:25 | call to taint : | hash_flow.rb:679:25:679:29 | hash2 [element :f] : |
| hash_flow.rb:679:12:679:16 | [post] hash1 [element :a] : | hash_flow.rb:691:11:691:15 | hash1 [element :a] : |