[Analyzer] alpha.unix.cstring.OutOfBounds checker enable/disable fix
authorAdam Balogh <adam.balogh@ericsson.com>
Fri, 13 Jul 2018 13:44:44 +0000 (13:44 +0000)
committerAdam Balogh <adam.balogh@ericsson.com>
Fri, 13 Jul 2018 13:44:44 +0000 (13:44 +0000)
commitbf966f523755c9f72886e90a98c15eae8d248cd8
tree1c888c86ea410bc482db28f780b0c72d9722445f
parentc48aefb63bb307e1c5e843a05b01a55509c3528b
[Analyzer] alpha.unix.cstring.OutOfBounds checker enable/disable fix

It was not possible to disable alpha.unix.cstring.OutOfBounds checker's reports
since unix.Malloc checker always implicitly enabled the filter. Moreover if the
checker was disabled from command line (-analyzer-disable-checker ..) the out
of bounds warnings were nevertheless emitted under different checker names such
as unix.cstring.NullArg, or unix.Malloc.

This patch fixes the case sot that Malloc checker only enables implicitly the
underlying modeling of strcpy, memcpy etc. but not the warning messages that
would have been emmitted by alpha.unix.cstring.OutOfBounds

Patch by: Dániel Krupp

Differential Revision: https://reviews.llvm.org/D48831

llvm-svn: 337000
clang/lib/StaticAnalyzer/Checkers/CStringChecker.cpp
clang/test/Analysis/cstring-plist.c [new file with mode: 0644]
clang/test/Analysis/malloc.c
clang/test/Analysis/string.c