Skip to content

Java: Support precondition calls as guards (ODASA-7796).#1189

Merged
yh-semmle merged 2 commits intogithub:masterfrom
aschackmull:java/preconditions
Apr 4, 2019
Merged

Java: Support precondition calls as guards (ODASA-7796).#1189
yh-semmle merged 2 commits intogithub:masterfrom
aschackmull:java/preconditions

Conversation

@aschackmull
Copy link
Contributor

@aschackmull aschackmull commented Apr 2, 2019

Fixes #986.

Calls need to be at the end of basic blocks in order to function as guards, so we add a few additional exception edges to the CFG. We already include such edges for calls nested inside finally blocks, so an argument could be made for simply adding such edges to all calls, but that would require additional testing to check how much the CFG would grow, so this seems safer.

@aschackmull aschackmull requested a review from a team as a code owner April 2, 2019 09:18
@aschackmull aschackmull changed the title Java: Support precondition calls as guards. Java: Support precondition calls as guards (ODASA-7796). Apr 2, 2019
@aschackmull
Copy link
Contributor Author

Query changes are looking good. All removed results were FPs and the two new results are TPs.

=== Overall changes (new / fixed) ===

                                                                            2 / 15


=== Changes per project (new / fixed) ===

apache-hadoop                                                               0 / 10
guava                                                                       2 / 5


=== Changes per query (new / fixed) ===

ArrayIndexOutOfBounds.ql                                                    0 / 15
UselessNullCheck.ql                                                         2 / 0

@yh-semmle yh-semmle merged commit b226cb6 into github:master Apr 4, 2019
@aschackmull aschackmull deleted the java/preconditions branch April 4, 2019 08:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants