[PATCH] D83115: [Analyzer] Report every bug if only uniqueing location differs.

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


Szelethus added reviewers: NoQ, vsavchenko, xazax.hun, martong.
Szelethus added a subscriber: NoQ.
Szelethus added inline comments.


================
Comment at: clang/lib/Analysis/PathDiagnostic.cpp:1136-1137
   ID.Add(getLocation());
+  ID.Add(getUniqueingLoc());
+  ID.AddPointer(getUniqueingLoc().isValid() ? getUniqueingDecl() : nullptr);
   ID.AddString(BugType);
----------------
This looks a bit odd -- why do we need both of these?

Also, didn't we use uniqueing location in the `BugReportEquivClass` or whatever its called? Why do we need to add this here as well? I would like some technical explanation.


================
Comment at: clang/test/Analysis/malloc.c:793
   int *p = malloc(12);
   p = malloc(12);
+} // expected-warning {{Potential leak of memory pointed to by}}\
----------------
On an unrelated note, shouldn't one of the notes be here? @NoQ, is this the same issue as the one you raised with zombie symbols? http://lists.llvm.org/pipermail/cfe-dev/2016-March/047922.html


================
Comment at: clang/test/Analysis/pr22954.c:346-356
   struct JJ J0 = {{{1, 2, 0}, {3, 4, 0}, {5, 6, 0}}, 0};
   J0.s2 = strdup("hello");
   J0.s1[0].s2 = strdup("hello");
   J0.s1[1].s2 = strdup("hi");
   J0.s1[2].s2 = strdup("world");
   char input[2] = {'a', 'b'};
   memcpy(J0.s1[i].s1, input, 2);
----------------
What a god awful test case.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D83115





More information about the cfe-commits mailing list