-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[annot] Do not iterate through every pair of sinks between caller and…
… callee Summary: Previously in annotation reachability, when we iterated on the summary for a given sink annotation for a source, we ignored the sink procedure name when iterating on callee's summary, causing us to call the reporting function multiple times for the same path. This did not always cause duplicates, because I assume reporting has some mechanism (e.g. we got the same bug hash). But this diff fixes it. Example: ``` 1 Sink void sink1() { } 2 Sink void sink2() { } 3 void intermediate() { 4 sink1(); 5 sink2(); 6 } 7 Source void source() { 8 intermediate(); 9 } ``` The summary of `intermediate`: ``` {Sink -> { sink1 -> {line 4}, sink2 -> {line 5}, }} ``` The summary of `source`: ``` {Sink -> { sink1 -> {line 8 via intermediate}, sink2 -> {line 8 via intermediate}, }} ``` Previously, when we were checking `sink1` for `source`, we've seen that it can be reached via `intermediate`. But when applying the summary of `intermediate` we iterated over both `sink1` and `sink2`. And the same goes for checking `sink2` for `source`. Reviewed By: rgrig Differential Revision: D62756696 fbshipit-source-id: 357e80b5cfaa3cc029b0bca3adc54de26ad75460
- Loading branch information
1 parent
22ac1ac
commit 452d96d
Showing
3 changed files
with
40 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters