]> granicus.if.org Git - clang/commit
[analyzer] Fix leak false positives on stuff put in C++/ObjC initializer lists.
authorArtem Dergachev <artem.dergachev@gmail.com>
Thu, 5 Oct 2017 08:43:32 +0000 (08:43 +0000)
committerArtem Dergachev <artem.dergachev@gmail.com>
Thu, 5 Oct 2017 08:43:32 +0000 (08:43 +0000)
commit7728f3542e45915878ff7f98d7dd14bca4fe933e
tree5355772ee91e6ae30d8073344496e2bac580fee5
parente2787a6b9332ec828889a6aa1de4d7738524110a
[analyzer] Fix leak false positives on stuff put in C++/ObjC initializer lists.

The analyzer now realizes that C++ std::initializer_list objects and
Objective-C boxed structure/array/dictionary expressions can potentially
maintain a reference to the objects that were put into them. This avoids
false memory leak posivites and a few other issues.

This is a conservative behavior; for now, we do not model what actually happens
to the objects after being passed into such initializer lists.

rdar://problem/32918288
Differential Revision: https://reviews.llvm.org/D35216

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@314975 91177308-0d34-0410-b5e6-96231b3b80d8
lib/StaticAnalyzer/Core/ExprEngine.cpp
test/Analysis/initializer.cpp
test/Analysis/objc-boxing.m
test/Analysis/objc-for.m