[PATCH] D83120: [Analyzer][StreamChecker] Using BugType::SuppressOnSink at resource leak report.

Kristóf Umann via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jul 10 04:06:12 PDT 2020


Szelethus added a reviewer: NoQ.
Szelethus accepted this revision.
Szelethus added a comment.
This revision is now accepted and ready to land.

LGTM! Though, the test file change is interesting. You could add a test that behaves differently from the previous implementation:

  {
    FILE *f = fopen(...);
  } // leak here
  
  10 / 0; // sink

Unless this `SuppressOnSink` behaves differently on sink //error// nodes -- I honestly don't know :^)



================
Comment at: clang/test/Analysis/stream.c:274-284
 // Check that "location uniqueing" works.
 // This results in reporting only one occurence of resource leak for a stream.
 void check_leak_noreturn_2() {
   FILE *F1 = tmpfile();
   if (!F1)
     return;
   if (Test == 1) {
----------------
Why did this change? Is there a sink in the return branch?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D83120





More information about the cfe-commits mailing list