- Feb 29, 2012
-
-
Anna Zaks authored
funopen, setvbuf. Teach the checker and the engine about these APIs to resolve malloc false positives. As I am adding more of these APIs, it is clear that all this should be factored out into a separate callback (for example, region escapes). Malloc, KeyChainAPI and RetainRelease checkers could all use it. llvm-svn: 151737
-
- Feb 28, 2012
-
-
Anna Zaks authored
When allocated buffer is passed to CF/NS..NoCopy functions, the ownership is transfered unless the deallocator argument is set to 'kCFAllocatorNull'. llvm-svn: 151608
-
Anna Zaks authored
closest function context. This prevents us from uniqueing all leaks from the same allocation helper. radar://10932226 llvm-svn: 151592
-
- Feb 25, 2012
-
-
Anna Zaks authored
Assume none of the ObjC messages defined in system headers free memory, except for the ones containing 'freeWhenDone' selector. Currently, just assume that the region escapes to the messages with 'freeWhenDone' (ideally, we want to treat it as 'free()'). For now, always assume that regions escape when passed to C++ methods. llvm-svn: 151410
-
- Feb 23, 2012
-
-
Anna Zaks authored
When we find two leak reports with the same allocation site, report only one of them. Provide a helper method to BugReporter to facilitate this. llvm-svn: 151287
-
Anna Zaks authored
Make this call an exception in ExprEngine::invalidateArguments: 'int pthread_setspecific(ptheread_key k, const void *)' stores a value into thread local storage. The value can later be retrieved with 'void *ptheread_getspecific(pthread_key)'. So even thought the parameter is 'const void *', the region escapes through the call. (Here we just blacklist the call in the ExprEngine's default logic. Another option would be to add a checker which evaluates the call and triggers the call to invalidate regions.) Teach the Malloc Checker, which treats all system calls as safe about the API. llvm-svn: 151220
-
- Feb 22, 2012
-
-
Anna Zaks authored
- We should not evaluate strdup in the Malloc Checker, it's the job of CString checker, so just update the RefState to reflect allocated memory. - Refactor to reduce LOC: remove some wrapper auxiliary functions, make all functions return the state and add the transition in one place (instead of in each auxiliary function). llvm-svn: 151188
-
Anna Zaks authored
llvm-svn: 151124
-
Anna Zaks authored
, when we return a symbol reachable to the malloced one via pointer arithmetic. llvm-svn: 151121
-
- Feb 20, 2012
-
-
Anna Zaks authored
tests. llvm-svn: 150993
-
- Feb 17, 2012
-
-
Anna Zaks authored
it aware of CString APIs that return the input parameter. Malloc Checker needs to know how the 'strcpy' function is evaluated. Introduce the dependency on CStringChecker for that. CStringChecker knows all about these APIs. Addresses radar://10864450 llvm-svn: 150846
-
- Feb 16, 2012
-
-
Anna Zaks authored
- Rename the category "Logic Error" -> "Memory Error". - Shorten all the messages. llvm-svn: 150733
-
Anna Zaks authored
of failing realloc. + Minor cleanups. llvm-svn: 150732
-
Anna Zaks authored
We are not properly handling the memory regions that escape into struct fields, which led to a bunch of false positives. Be conservative here and give up when a pointer escapes into a struct. llvm-svn: 150658
-
- Feb 15, 2012
- Feb 14, 2012
-
-
Anna Zaks authored
(In response of Ted's review of r150112.) This moves the logic which checked if a symbol escapes through a parameter to invalidateRegionCallback (instead of post CallExpr visit.) To accommodate the change, added a CallOrObjCMessage parameter to checkRegionChanges callback. llvm-svn: 150513
-
Anna Zaks authored
in realloc map. If there is no dependency, the reallocated ptr will get garbage collected before we know that realloc failed, which would lead us to missing a memory leak warning. Also added new test cases, which we can handle now. Plus minor cleanups. llvm-svn: 150446
-
- Feb 13, 2012
-
-
Anna Zaks authored
case when size is 0. llvm-svn: 150412
-
Anna Zaks authored
1) Support the case when realloc fails to reduce False Positives. (We essentially need to restore the state of the pointer being reallocated.) 2) Realloc behaves differently under special conditions (from pointer is null, size is 0). When detecting these cases, we should consider under-constrained states (size might or might not be 0). The old version handled this in a very hacky way. The code did not differentiate between definite and possible (no consideration for under-constrained states). Further, after processing each special case, the realloc processing function did not return but chained to the next special case processing. So you could end up in an execution in which you first see the states in which size is 0 and realloc ~ free(), followed by the states corresponding to size is not 0 followed by the evaluation of the regular realloc behavior. llvm-svn: 150402
-
- Feb 12, 2012
-
-
Anna Zaks authored
a pointer cannot escape through calls to system functions. Also, stop after reporting the first use-after-free. llvm-svn: 150315
-
- Feb 11, 2012
-
-
Anna Zaks authored
memory. (As per one test case, the existing checker thought that this could cause a lot of false positives - not sure if that's valid, to be verified.) llvm-svn: 150313
-
Anna Zaks authored
Resolves a common false positive, where we were reporting a leak inside asserts llvm-svn: 150312
-
Anna Zaks authored
We use the same logic here as the RetainRelease checker. llvm-svn: 150311
-
- Feb 10, 2012
-
-
Anna Zaks authored
(use of return instead of continue), wording. llvm-svn: 150215
-
- Feb 09, 2012
-
-
Benjamin Kramer authored
llvm-svn: 150172
-
Anna Zaks authored
llvm-svn: 150158
-
Anna Zaks authored
Very simple so far - we just highlight every allocation and release site. llvm-svn: 150156
-
Anna Zaks authored
llvm-svn: 150155
-
Anna Zaks authored
which allows values to escape through unknown calls. Assumes all calls but the malloc family are unknown. Also, catch a use-after-free when a pointer is passed to a function after a call to free (previously, you had to explicitly dereference the pointer value). llvm-svn: 150112
-
Anna Zaks authored
optimistic. TODO: actually implement the pessimistic version of the checker. Ex: it needs to assume that any function that takes a pointer might free it. The optimistic version relies on annotations to tell us which functions can free the pointer. llvm-svn: 150111
-
- Feb 08, 2012
-
-
Anna Zaks authored
post visit of CallExpr. In general, we should avoid using evalCall as it leads to interference with other checkers. llvm-svn: 150086
-
- Feb 05, 2012
-
-
Dylan Noblesmith authored
(I was going to fix the TODO about DenseMap too, but that would break self-host right now. See PR11922.) llvm-svn: 149799
-
Dylan Noblesmith authored
llvm-svn: 149798
-
- Feb 04, 2012
-
-
Benjamin Kramer authored
Fix all the transitive include users. llvm-svn: 149783
-
Benjamin Kramer authored
Fix all the files that depended on transitive includes of Diagnostic.h. With this patch in place changing a diagnostic no longer requires a full rebuild of the StaticAnalyzer. llvm-svn: 149781
-
- Jan 26, 2012
-
-
Ted Kremenek authored
At this point this is largely cosmetic, but it opens the door to replace ProgramStateRef with a smart pointer that more eagerly acts in the role of reclaiming unused ProgramState objects. llvm-svn: 149081
-
- Jan 17, 2012
-
-
David Blaikie authored
This allows -Wswitch-enum to find switches that need updating when these enums are modified. llvm-svn: 148281
-
- Jan 06, 2012
-
-
Ted Kremenek authored
(Stmt*,LocationContext*) pairs to SVals instead of Stmt* to SVals. This is needed to support basic IPA via inlining. Without this, we cannot tell if a Stmt* binding is part of the current analysis scope (StackFrameContext) or part of a parent context. This change introduces an uglification of the use of getSVal(), and thus takes two steps forward and one step back. There are also potential performance implications of enlarging the Environment. Both can be addressed going forward by refactoring the APIs and optimizing the internal representation of Environment. This patch mainly introduces the functionality upon when we want to build upon (and clean up). llvm-svn: 147688
-