-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for short-circuit
||
in non-conditional flows (#227)
This PR adds support for short-circuit `||` in non-conditional flows, thereby reducing false positives. For example, ``` return x == nil || *x == 1 ``` was reported as a false positive, since NilAway only analyzed `&&`. We apply logic similar to the handling of `&&`. Because this analysis resides in the recursion of the short-circuit expression, where we have limited context visibility, it makes it difficult to accurately analyze complex expressions. Therefore, with extending support for `||`, we had to trade-off some of the precision we previously had with only the `&&` support. However, we made this tough choice since empirically we observed that complex cases that we had to trade-off did not occur frequently enough, while simple `||` patterns were more prevalent. I have created issue #226 to keep a track of the comprehensive support that we plan to add in the future. [closes #92 ]
- Loading branch information
1 parent
29def5e
commit 755a685
Showing
2 changed files
with
113 additions
and
8 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