Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support validation via custom bool functions #267

Closed
sonalmahajan15 opened this issue Aug 5, 2024 · 1 comment
Closed

Support validation via custom bool functions #267

sonalmahajan15 opened this issue Aug 5, 2024 · 1 comment
Labels
duplicate This issue or pull request already exists false positive Requires more analysis and support

Comments

@sonalmahajan15
Copy link
Contributor

Currently, NilAway does not track nilability checked via custom boolean returning functions. Hence, this results in false positives, such as in the example shown below.

func isValNil(val *int) bool {
	return val == nil
}

func test() {
	var x *int
	if !isValNil(x) {
		_ = *x // FP: unassigned variable `x` dereferenced
	}
}
@sonalmahajan15 sonalmahajan15 added the false positive Requires more analysis and support label Aug 5, 2024
@sonalmahajan15 sonalmahajan15 added the duplicate This issue or pull request already exists label Sep 5, 2024
@sonalmahajan15
Copy link
Contributor Author

Duplicate of issue #212 .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists false positive Requires more analysis and support
Projects
None yet
Development

No branches or pull requests

1 participant