-
Notifications
You must be signed in to change notification settings - Fork 8
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
removal of closures and functions that contain assert
macros cause false positives
#502
Comments
For both of these cases, I think the right thing to do is walk the function/closure bodies. Closures are a little tricky, though. For the case of spawning a thread (e.g., the closure body is always executed), I think walking the closure body is probably the right policy. But if the closure is executed conditionally, the situation becomes more complicated. See, e.g., the example in the README: https://github.com/trailofbits/necessist#example FWIW, I outlined a strategy for choosing what to remove/ignore in this PR: #474 I think what I wrote here is largely consistent with that PR, though closures require more thought. |
Regarding the second bullet, I am jotting down some notes about how it could work. These ideas are by no means set in stone.
The above are used as follows:
A crucial point is that logic that is common among the backends is in the |
Necessist will warn that a test is passing with code remove for the following examples:
Both of these mutations do not indicate that a test statement is unnecessary, and I think they should be ignored since
assert
is ignored.The text was updated successfully, but these errors were encountered: