651f13cea278ec967336033dd032faef0e9fc2ec |
|
24-Apr-2014 |
Stephen Hines <srhines@google.com> |
Updated to Clang 3.5a. Change-Id: I8127eb568f674c2e72635b639a3295381fe8af82
/external/clang/test/Analysis/new.cpp
|
81557223ba8d7ef8b0468a6e1dc8fc79f2de46f2 |
|
25-Sep-2013 |
Jordan Rose <jordan_rose@apple.com> |
[analyzer] Handle destructors for the argument to C++ 'delete'. Now that the CFG includes nodes for the destructors in a delete-expression, process them in the analyzer using the same common destructor interface currently used for local, member, and base destructors. Also, check for when the value is known to be null, in which case no destructor is actually run. This does not yet handle destructors for deleted /arrays/, which may need more CFG work. It also causes a slight regression in the location of double delete warnings; the double delete is detected at the destructor call, which is implicit, and so is reported on the first access within the destructor instead of at the 'delete' statement. This will be fixed soon. Patch by Karthik Bhat! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191381 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Analysis/new.cpp
|
8f6134c308951a72642eebb65a44408ea1e237a8 |
|
10-Jul-2013 |
Jordan Rose <jordan_rose@apple.com> |
[analyzer] Remove bogus assert: in C++11, 'new' can do list-initialization. Previously, we asserted that whenever 'new' did not include a constructor call, the type must be a non-record type. In C++11, however, uniform initialization syntax (braces) allow 'new' to construct records with list-initialization: "new Point{1, 2}". Removing this assertion should be perfectly safe; the code here matches what VisitDeclStmt does for regions allocated on the stack. <rdar://problem/14403437> git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186028 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Analysis/new.cpp
|
55e57a50a36749ce0483db2f16259649c9d25792 |
|
11-Apr-2013 |
Anton Yartsev <anton.yartsev@gmail.com> |
[analyzer] Switched to checkPreCall interface for detecting usage after free. Now the check is also applied to arguments for Objective-C method calls and to 'this' pointer. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179230 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Analysis/new.cpp
|
68eb4c25e961d18f82b47a0a385f90d7af09bcc3 |
|
06-Apr-2013 |
Anna Zaks <ganna@apple.com> |
[analyzer] Shorten the malloc checker’s leak message As per Ted’s suggestion! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178938 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Analysis/new.cpp
|
e6f2bf86288bc45060b21c4f55a6153b8ba80443 |
|
30-Mar-2013 |
Jordan Rose <jordan_rose@apple.com> |
[analyzer] Handle caching out while evaluating a C++ new expression. Evaluating a C++ new expression now includes generating an intermediate ExplodedNode, and this node could very well represent a previously- reachable state in the ExplodedGraph. If so, we can short-circuit the rest of the evaluation. Caught by the assertion a few lines later. <rdar://problem/13510065> git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178401 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Analysis/new.cpp
|
b061720ddf88b4a1934dbbb1b874a424716cd7d7 |
|
27-Mar-2013 |
Jordan Rose <jordan_rose@apple.com> |
[analyzer] Use evalBind for C++ new of scalar types. These types will not have a CXXConstructExpr to do the initialization for them. Previously we just used a simple call to ProgramState::bindLoc, but that doesn't trigger proper checker callbacks (like pointer escape). Found by Anton Yartsev. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178160 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Analysis/new.cpp
|
2de19edab6001d2c17720d02fe0760b9b452192a |
|
25-Mar-2013 |
Anton Yartsev <anton.yartsev@gmail.com> |
[analyzer] Adds cplusplus.NewDelete checker that check for memory leaks, double free, and use-after-free problems of memory managed by new/delete. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177849 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Analysis/new.cpp
|
c210cb7a358d14cdd93b58562f33ff5ed2d895c1 |
|
27-Aug-2012 |
Jordan Rose <jordan_rose@apple.com> |
[analyzer] Inline constructors for any object with a trivial destructor. This allows us to better reason about status objects, like Clang's own llvm::Optional (when its contents are trivially destructible), which are often intended to be passed around by value. We still don't inline constructors for temporaries in the general case. <rdar://problem/11986434> git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162681 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Analysis/new.cpp
|
89e5aaf57e20b39e35b0d068ebbc09ae736f2e1e |
|
17-Jul-2012 |
Jordan Rose <jordan_rose@apple.com> |
[analyzer] Handle new-expressions with initializers for scalars. <rdar://problem/11818967> git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160328 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Analysis/new.cpp
|
70cbf3cc09eb21db1108396d30a414ea66d842cc |
|
03-Jul-2012 |
Jordan Rose <jordan_rose@apple.com> |
[analyzer] Introduce CXXAllocatorCall to handle placement arg invalidation. This is NOT full-blown support for operator new, but removes some nasty duplicated code introduced in r158784. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159608 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Analysis/new.cpp
|
ee681111c713f300884550b1503713ade3b32374 |
|
25-Jun-2012 |
Jordan Rose <jordan_rose@apple.com> |
[analyzer] Be careful about implicitly-declared operator new/delete. (PR13090) The implicit global allocation functions do not have valid source locations, but we still want to treat them as being "system header" functions for the purposes of how they affect program state. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159160 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Analysis/new.cpp
|
3c4e76d712eac172b100bb10b96637ffca105433 |
|
20-Jun-2012 |
Jordan Rose <jordan_rose@apple.com> |
[analyzer] Move failing 'new' test cases back into new.cpp instead of XFAILing. Per Anna's comment, this is a better way to handle "to-do list"-type failures. This way we'll know if any of the features get fixed; in an XFAIL file, /all/ the cases have to be fixed before lit would tell us anything. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158791 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Analysis/new.cpp
|
e38c1c2c449529e60f48e740cb8662e68e5a5330 |
|
20-Jun-2012 |
Jordan Rose <jordan_rose@apple.com> |
[analyzer] Invalidate placement args; return the pointer given to placement new The default global placement new just returns the pointer it is given. Note that other custom 'new' implementations with placement args are not guaranteed to do this. In addition, we need to invalidate placement args, since they may be updated by the allocator function. (Also, right now we don't properly handle the constructor inside a CXXNewExpr, so we need to invalidate the placement args just so that callers know something changed!) This invalidation is not perfect because CallOrObjCMessage doesn't support CXXNewExpr, and all of our invalidation callbacks expect that if there's no CallOrObjCMessage, the invalidation is happening manually (e.g. by a direct assignment) and shouldn't affect checker-specific metadata (like malloc state); hence the malloc test case in new-fail.cpp. But region values are now properly invalidated, at least. The long-term solution to this problem is to rework CallOrObjCMessage into something more general, rather than the morass of branches it is today. <rdar://problem/11679031> git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158784 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Analysis/new.cpp
|
2aed8b88613863f3c439cdfb205bdf8b608fb205 |
|
16-Feb-2012 |
Sebastian Redl <sebastian.redl@getdesigned.at> |
Revert "Revert "Make CXXNewExpr contain only a single initialier, and not hold the used constructor itself."" This reintroduces commit r150682 with a fix for the Bullet benchmark crash. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150685 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Analysis/new.cpp
|
1548d14f4092a817f7d90ad3e7a65266dc85fbc5 |
|
16-Feb-2012 |
Sebastian Redl <sebastian.redl@getdesigned.at> |
Revert "Make CXXNewExpr contain only a single initialier, and not hold the used constructor itself." It leads to a compiler crash in the Bullet benchmark. This reverts commit r12014. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150684 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Analysis/new.cpp
|
5f688f4b15d02aa7ad159c46b1f78fe59d412f12 |
|
16-Feb-2012 |
Sebastian Redl <sebastian.redl@getdesigned.at> |
Make CXXNewExpr contain only a single initialier, and not hold the used constructor itself. Holding the constructor directly makes no sense when list-initialized arrays come into play. The constructor is now held in a CXXConstructExpr, if construction is what is done. The new design can also distinguish properly between list-initialization and direct-initialization, as well as implicit default-initialization constructors and explicit value-initialization constructors. Finally, doing it this way removes redundance from the AST because CXXNewExpr doesn't try to handle both the allocation and the initialization responsibilities. This breaks the static analysis of new expressions. I've filed PR12014 to track this. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150682 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Analysis/new.cpp
|
c4d2c9074be6eb2091086eddd6c8f052f3b245c8 |
|
28-Feb-2011 |
Argyrios Kyrtzidis <akyrtzi@gmail.com> |
[analyzer] Remove '-analyzer-check-objc-mem' flag, the nominee for best misnomer award. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126676 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Analysis/new.cpp
|
cc05d511b26ac6dc80fcbcc78ac305d2755aa0b9 |
|
28-Feb-2011 |
Argyrios Kyrtzidis <akyrtzi@gmail.com> |
[analyzer] Migrate UndefBranchChecker to CheckerV2. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126616 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Analysis/new.cpp
|
48fb32230541a434ae79064085101d3ea84fb14e |
|
21-Apr-2010 |
Zhongxing Xu <xuzhongxing@gmail.com> |
The second check point in the old test case was invalid. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101983 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Analysis/new.cpp
|
40ab43b29bff9a240e5281e5952f59ddee623fca |
|
20-Apr-2010 |
Zhongxing Xu <xuzhongxing@gmail.com> |
Add test cases. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101878 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Analysis/new.cpp
|