llvm-project/clang/test
Jordan Rose 801916baf1 [analyzer] Suppress paths involving a reference whose rvalue is null.
Most map types have an operator[] that inserts a new element if the key
isn't found, then returns a reference to the value slot so that you can
assign into it. However, if the value type is a pointer, it will be
initialized to null. This is usually no problem.

However, if the user /knows/ the map contains a value for a particular key,
they may just use it immediately:

   // From ClangSACheckersEmitter.cpp
   recordGroupMap[group]->Checkers

In this case the analyzer reports a null dereference on the path where the
key is not in the map, even though the user knows that path is impossible
here. They could silence the warning by adding an assertion, but that means
splitting up the expression and introducing a local variable. (Note that
the analyzer has no way of knowing that recordGroupMap[group] will return
the same reference if called twice in a row!)

We already have logic that says a null dereference has a high chance of
being a false positive if the null came from an inlined function. This
patch simply extends that to references whose rvalues are null as well,
silencing several false positives in LLVM.

<rdar://problem/13239854>

llvm-svn: 176371
2013-03-01 19:45:10 +00:00
..
ARCMT [arcmt] Make sure the function has an associated parameter for the argument 2013-02-14 17:29:16 +00:00
ASTMerge Fix code that attempted to produce a diagnostic with one DiagnosticEngine, then 2012-12-20 02:22:15 +00:00
Analysis [analyzer] Suppress paths involving a reference whose rvalue is null. 2013-03-01 19:45:10 +00:00
CXX Don't crash when diagnosing path-constrained protected 2013-02-27 00:08:19 +00:00
CodeCompletion PR14381: Never skip constexpr function bodies when code-completing. We may need 2012-11-19 21:13:18 +00:00
CodeGen Add more of the command line options as attribute flags. 2013-02-28 22:49:57 +00:00
CodeGenCUDA CUDA: give static storage class to __shared__ and __constant__ 2012-08-28 20:37:50 +00:00
CodeGenCXX Add more of the command line options as attribute flags. 2013-02-28 22:49:57 +00:00
CodeGenObjC Add more of the command line options as attribute flags. 2013-02-28 22:49:57 +00:00
CodeGenObjCXX Perform the receiver-expression transformations regardless of 2013-03-01 09:20:14 +00:00
CodeGenOpenCL Add a 64-bit triple to these tests, to fix 32-bit bots. 2013-02-21 13:42:33 +00:00
Coverage Revert r166541, "clang/test: Add appropriate requirements as REQUIRES, corresponding to r166532." 2012-10-24 03:59:09 +00:00
Driver Add more of the command line options as attribute flags. 2013-02-28 22:49:57 +00:00
FixIt Fix warning text of my last patch. 2013-02-28 23:16:39 +00:00
Frontend [driver] Warnings for warning options are handled by the frontend. The driver needs to process the 2013-01-15 01:21:53 +00:00
Headers libstdc++'s <cstdalign> #includes <stdalign.h> and expects it to guard against 2013-02-21 02:17:58 +00:00
Index Add comment to my last test. 2013-02-28 18:03:28 +00:00
Lexer Lexer: Don't warn about Unicode in preprocessor directives. 2013-01-31 19:48:48 +00:00
Misc Update template diffing to handle template arguments that are declarations. 2013-02-27 01:41:53 +00:00
Modules Ensure that the identifier chains have the most recent declaration after module deserialization. 2013-02-18 15:53:43 +00:00
OpenMP Add initial rough support for synthesizing linker options when passed 2013-01-17 13:19:29 +00:00
PCH Add a test case, to make sure there is no crash on IRGen when using PCH 2013-02-28 01:13:53 +00:00
Parser Fix warning text of my last patch. 2013-02-28 23:16:39 +00:00
Preprocessor Add a test to make sure __has_include works from inside a macro. 2013-02-27 01:34:48 +00:00
Rewriter objective-C modern translator: Fixes a mistranslation 2013-02-11 19:30:33 +00:00
Sema comment parsing: Properties are considered like methods, and people 2013-02-27 00:46:06 +00:00
SemaCUDA
SemaCXX Fix initializer for variables with attribute address_space set. 2013-02-26 21:15:54 +00:00
SemaObjC Perform the receiver-expression transformations regardless of 2013-03-01 09:20:14 +00:00
SemaObjCXX objective-C arc: Diagnostic can not say to use bridge 2013-02-22 01:22:48 +00:00
SemaOpenCL Add a 64-bit triple to these tests, to fix 32-bit bots. 2013-02-21 13:42:33 +00:00
SemaTemplate PR15360: nullptr as a non-type template argument to a function type non-type template parameter 2013-02-27 22:10:40 +00:00
TableGen Revert "tg-fixits.td: fixup for Linux" 2013-01-11 02:37:47 +00:00
Tooling Add indents to AST dumping and removed parenthesis from AST nodes. 2013-01-31 01:44:26 +00:00
Unit
CMakeLists.txt CMake: Include Clang unit tests in check-clang target in standalone builds. 2013-02-08 07:28:25 +00:00
Makefile
TestRunner.sh
cxx-sections.data
lit.cfg clang/test/Driver/darwin-sdkroot.c: Suppress this on msys bash, to introduce the feature "shell-preserves-root". 2013-01-16 06:10:16 +00:00
lit.site.cfg.in
make_test_dirs.pl