[PATCH] D41538: [analyzer] Fix some checker's output plist not containing the checker name #2

Aleksei Sidorin via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Dec 29 07:48:55 PST 2017


a.sidorin added inline comments.


================
Comment at: lib/StaticAnalyzer/Checkers/ValistChecker.cpp:277
+      BT_leakedvalist.reset(new BugType(
+          CheckNames[ReportUninit ? CK_Uninitialized : CK_Unterminated],
+          "Leaked va_list", categories::MemoryError));
----------------
xazax.hun wrote:
> a.sidorin wrote:
> > If I understand correctly, if we report uninitialized and then unterminated, the second report will have wrong CheckName because it is never reset.
> That is right. Unfortunately, If unterminated check is not turned on but uninitialized is, we can end up with empty check names. I replaced this workaround with a slightly more robust one.
Maybe we should use different BugTypes for Uninitialized and Unterminated?


================
Comment at: test/Analysis/malloc.c:1723
 
-char *dupstrWarn(const char *s) {
-  const int len = strlen(s);
----------------
xazax.hun wrote:
> a.sidorin wrote:
> > Should we enable the checker instead of removing test?
> I tried that once, but this caused more new warnings (and sinks) so more changes would be required to make the tests pass. And this case is already tested in `string.c`.
Thank you, I got it.


https://reviews.llvm.org/D41538





More information about the cfe-commits mailing list