[PATCH] D81407: [Analyzer][StreamChecker] Add note tags for file opening.

Balázs Kéri via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jun 11 00:37:37 PDT 2020


balazske added a comment.

In D81407#2080273 <https://reviews.llvm.org/D81407#2080273>, @Szelethus wrote:

> > If there are multiple resource leak paths for the same stream, only one wil be reported.
>
> What is the rationale behind this? Do all leaks from the same opening describe the same kind of error? Is this based on observations on a codebase?


The code was taken from `FuchsiaHandleChecker`. I do not know which approach to use, it may be that reporting all leak paths is better, these are really different problems. But I did not like getting many similar looking bug reports at a function that opens a file and then in various error cases stops the program by a "noreturn" function. At every such case a false positive resource leak is reported (I think it is OK to not close the file at stopping the program specially if there is some kind of error). Or the checker can be improved to find at a `checkDeadSymbols` if the program execution is stopping and do not report resource leak in that case.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D81407/new/

https://reviews.llvm.org/D81407





More information about the cfe-commits mailing list