- Nov 15, 2012
-
-
Jordan Rose authored
Also, don't bother to stop tracking symbols in the return value, either. They are now properly considered live during checkDeadSymbols. llvm-svn: 168067
-
- Nov 13, 2012
-
-
Anna Zaks authored
This simplifies logic, fixes a bug, and adds a test case. Thanks Jordan! llvm-svn: 167868
-
Anna Zaks authored
and other functions. When these functions return null, the pointer is not freed by them/ownership is not transfered. So we should allow the user to free the pointer by calling another function when the return value is NULL. llvm-svn: 167813
-
- Nov 02, 2012
-
-
Jordan Rose authored
Also, move the REGISTER_*_WITH_PROGRAMSTATE macros to ProgramStateTrait.h. This doesn't get rid of /all/ explicit uses of ProgramStatePartialTrait, but it does get a lot of them. llvm-svn: 167276
-
Jordan Rose authored
No functionality change. llvm-svn: 167275
-
- Nov 01, 2012
-
-
Jordan Rose authored
llvm-svn: 167189
-
Jordan Rose authored
(and the same for isFalse) No functionality change. llvm-svn: 167186
-
- Oct 29, 2012
-
-
Anna Zaks authored
No need for the auxiliary flag. No need to generate a leak node when there is no error. llvm-svn: 166977
-
- Sep 22, 2012
-
-
Jordan Rose authored
Just a refactoring of common infrastructure. No intended functionality change. llvm-svn: 164443
-
- Sep 20, 2012
-
-
Jordan Rose authored
If someone provides their own function called 'strdup', or 'reallocf', or even 'malloc', and we inlined it, the inlining should have given us all the malloc-related information we need. If we then try to attach new information to the return value, we could end up with spurious warnings. <rdar://problem/12317671> llvm-svn: 164276
-
- Sep 17, 2012
-
-
Anna Zaks authored
in ObjCMethods. Extend FunctionTextRegion to represent ObjC methods as well as functions. Note, it is not clear what type ObjCMethod region should return. Since the type of the FunctionText region is not currently used, defer solving this issue. llvm-svn: 164046
-
- Sep 13, 2012
-
-
Anna Zaks authored
llvm-svn: 163749
-
- Sep 08, 2012
-
-
Ted Kremenek authored
with at least one subtle bug in MacOSXKeyChainAPIChecker where the calling the method was a substitute for assuming a symbolic value was null (which is not the case). We still keep ConstraintManager::getSymVal(), but we use that as an optimization in SValBuilder and ProgramState::getSVal() to constant-fold SVals. This is only if the ConstraintManager can provide us with that information, which is no longer a requirement. As part of this, introduce a default implementation of ConstraintManager::getSymVal() which returns null. For Checkers, introduce ConstraintManager::isNull(), which queries the state to see if the symbolic value is constrained to be a null value. It does this without assuming it has been implicitly constant folded. llvm-svn: 163428
-
- Aug 24, 2012
-
-
Anna Zaks authored
When reallocation of a non-allocated (not owned) symbol fails do not expect it to be freed. llvm-svn: 162533
-
- Aug 22, 2012
-
-
Ted Kremenek authored
Also rename 'getCurrentBlockCounter()' to 'blockCount()'. This ripples a bunch of code simplifications; mostly aesthetic, but makes the code a bit tighter. llvm-svn: 162349
-
- Aug 09, 2012
-
-
Anna Zaks authored
Remove Escaped state, which is not really necessary. We can just stop tracking the symbol instead of keeping it around and marking escaped. llvm-svn: 161557
-
- Aug 08, 2012
-
-
Jordan Rose authored
Unfortunately, generalized region printing is very difficult: - ElementRegions are used both for casting and as actual elements. - Accessing values through a pointer means going through an intermediate SymbolRegionValue; symbolic regions are untyped. - Referring to implicitly-defined variables like 'this' and 'self' could be very confusing if they come from another stack frame. We fall back to simply not printing the region name if we can't be sure it will print well. This will allow us to improve in the future. llvm-svn: 161512
-
Jordan Rose authored
The main blocker on this (besides the previous commit) was that ScanReachableSymbols was not looking through LazyCompoundVals. Once that was fixed, it's easy enough to clear out malloc data on return, just like we do when we bind to a global region. <rdar://problem/10872635> llvm-svn: 161511
-
- Aug 04, 2012
-
-
Anna Zaks authored
We can be in the situation where we did not track the symbol before realloc was called on it. llvm-svn: 161294
-
- Aug 03, 2012
-
-
Anna Zaks authored
There is no reason why we should not track the memory which was not allocated in the current function, but was freed there. This would allow to catch more use-after-free and double free with no/limited IPA. Also fix a realloc issue which surfaced as the result of this patch. llvm-svn: 161248
-
- Jul 26, 2012
-
-
Jordan Rose authored
llvm-svn: 160815
-
- Jul 11, 2012
-
-
Jordan Rose authored
C++ method calls and C function calls both appear as CallExprs in the AST. This was causing crashes for an object that had a 'free' method. <rdar://problem/11822244> llvm-svn: 160029
-
Jordan Rose authored
These ProgramPoints are used in inlining calls, and not all calls have associated statements anymore. llvm-svn: 160021
-
Jordan Rose authored
These are currently unused, but are intended to be used in lieu of PreStmt and PostStmt when the call is implicit (e.g. an automatic object destructor). This also modifies the Data1 field of ProgramPoints to allow storing any pointer-sized value, as opposed to only aligned pointers. This is necessary to store SourceLocations. There is currently no BugReporter support for these; they should be skipped over in any diagnostic output. This commit also tags checkers that currently rely on function calls only occurring at StmtPoints. llvm-svn: 160019
-
- Jul 02, 2012
-
-
Jordan Rose authored
The preObjCMessage and postObjCMessage callbacks now take an ObjCMethodCall argument, which can represent an explicit message send (ObjCMessageSend) or an implicit message generated by a property access (ObjCPropertyAccess). llvm-svn: 159559
-
Jordan Rose authored
Previously, the CallEvent subclass ObjCMessageInvocation was just a wrapper around the existing ObjCMessage abstraction (over message sends and property accesses). Now, we have abstract CallEvent ObjCMethodCall with subclasses ObjCMessageSend and ObjCPropertyAccess. In addition to removing yet another wrapper object, this should make it easy to add a ObjCSubscriptAccess call event soon. llvm-svn: 159558
-
Jordan Rose authored
This involved refactoring some common pointer-escapes code onto CallEvent, then having MallocChecker use those callbacks for whether or not to consider a pointer's /ownership/ as escaping. This still needs to be pinned down, and probably we want to make the new argumentsMayEscape() function a little more discerning (content invalidation vs. ownership/metadata invalidation), but this is a good improvement. As a bonus, also remove CallOrObjCMessage from the source completely. llvm-svn: 159557
-
Jordan Rose authored
This is intended to replace CallOrObjCMessage, and is eventually intended to be used for anything that cares more about /what/ is being called than /how/ it's being called. For example, inlining destructors should be the same as inlining blocks, and checking __attribute__((nonnull)) should apply to the allocator calls generated by operator new. llvm-svn: 159554
-
- Jun 25, 2012
-
-
Jordan Rose authored
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. llvm-svn: 159160
-
- Jun 23, 2012
- Jun 22, 2012
-
-
Anna Zaks authored
transfered with dataWithBytesNoCopy. llvm-svn: 158958
-
- Jun 21, 2012
-
-
Anna Zaks authored
llvm-svn: 158875
-
- Jun 20, 2012
-
-
Anna Zaks authored
This commits sets the grounds for more aggressive use after free checking. We will use the Relinquished sate to denote that someone else is now responsible for releasing the memory. llvm-svn: 158850
-
- Jun 19, 2012
-
-
Anna Zaks authored
(Fixes radar://11691035 PR13140) llvm-svn: 158703
-
- Jun 16, 2012
-
-
Jordan Rose authored
Specifically, although the bitmap context does not take ownership of the buffer (unlike CGBitmapContextCreateWithData), the data buffer can be extracted out of the created CGContextRef. Thus the buffer is not leaked even if its original pointer goes out of scope, as long as - the context escapes, or - it is retrieved via CGBitmapContextGetData and freed. Actually implementing that logic is beyond the current scope of MallocChecker, so for now CGBitmapContextCreate goes on our system function exception list. llvm-svn: 158579
-
- Jun 07, 2012
-
-
Anna Zaks authored
Add a concept of symbolic memory region belonging to heap memory space. When comparing symbolic regions allocated on the heap, assume that they do not alias. Use symbolic heap region to suppress a common false positive pattern in the malloc checker, in code that relies on malloc not returning the memory aliased to other malloc allocations, stack. llvm-svn: 158136
-
- Jun 02, 2012
-
-
- May 19, 2012
-
-
Anna Zaks authored
llvm-svn: 157081
-
- May 18, 2012
-
-
Anna Zaks authored
allocating functions. llvm-svn: 157037
-