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

Gábor Horváth via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Sep 5 05:15:30 PDT 2017


xazax.hun added a comment.

In https://reviews.llvm.org/D37437#860311, @NoQ wrote:

> Cool. Thanks!
>
> > In the future probably it would be better to alter the signature of the checkers' constructor to set the name in the constructor so it is possible to create the BugType eagerly.
>
> Still, should we add an assertion so that we could be sure that every bug type contains a checker name?


Sure! I added the assert and discovered lots of other checks that had the same problem. I also discovered some other bugs, e.g.: when a checker was emitting diagnostic even without being turned on or the wrong name is emitted to the plist.



================
Comment at: test/Analysis/malloc.c:1723
 
-char *dupstrWarn(const char *s) {
-  const int len = strlen(s);
----------------
This test is deleted because the corresponding checker is not even turned on for this file and this warning should not be emitted at all. Emitting this warning with the settings above was a bug. 


https://reviews.llvm.org/D37437





More information about the cfe-commits mailing list