-
Notifications
You must be signed in to change notification settings - Fork 12.3k
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
[analyzer] Wrong warning location of memory leak #120586
Comments
@llvm/issue-subscribers-clang-static-analyzer Author: Michael (mvpant)
```c
// clang --analyze -Xanalyzer -analyzer-output=text
#include <stdint.h> void leak(bool v1) { void leak2(bool v1) { void caller() {
|
Looks like the leak is getting reported on a path immediately after It's not a wrong spot to warn, the question is if this is the best spot to warn or if a different warning message would help |
Your assessment is correct. To me, it looks good, but I'm already used to weirdly placed leak diags. |
Btw, why do you expect for the first leak case the diag at the first return statement? If I'd follow the reasoning, wouldn't be equally expected at the other return statement too? |
Godbolt example
The text was updated successfully, but these errors were encountered: