Skip to content
This repository has been archived by the owner on Jul 27, 2022. It is now read-only.

Null checks in method argument #22

Open
llbit opened this issue Aug 3, 2016 · 0 comments
Open

Null checks in method argument #22

llbit opened this issue Aug 3, 2016 · 0 comments

Comments

@llbit
Copy link
Contributor

llbit commented Aug 3, 2016

The Nullable Dereference analyzer currently does not handle the case when a null check is performed by passing the result of the null check to a function that aborts execution if the checked parameter was null, for example:

void m(@Nullable String argument) {
  ensureTrue(argument != null);  // Throws exception if argument == null.
  argument.hashCode();  // False positive generated here.
}

To be able to exactly analyze the above an intraprocedural analysis would be required, so to avoid this false positive the analyzer could just stop analyzing the rest of the control flow after it sees the parameter inside an expression that is passed ot a method.

llbit added a commit to llbit/simplecfg that referenced this issue Aug 4, 2016
llbit added a commit to llbit/simplecfg that referenced this issue Aug 4, 2016
llbit added a commit to llbit/simplecfg that referenced this issue Aug 4, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant