- Jun 19, 2012
-
-
Anna Zaks authored
(Fixes radar://11691035 PR13140) llvm-svn: 158703
-
- Jun 18, 2012
-
-
Jordan Rose authored
llvm-svn: 158681
-
- Jun 16, 2012
-
-
Jordan Rose authored
llvm-svn: 158588
-
Jordan Rose authored
This happens in C++ mode right at the declaration of a struct VLA; MallocChecker sees a bind and tries to get see if it's an escaping bind. It's likely that our handling of this is still incomplete, but it fixes a crash on valid without disturbing anything else for now. llvm-svn: 158587
-
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
-
James Dennett authored
llvm-svn: 158566
-
- Jun 15, 2012
-
-
Jordan Rose authored
We already didn't track objects that have delegates or callbacks or objects that are passed through void * "context pointers". It's a not-uncommon pattern to release the object in its callback, and so the leak message we give is not very helpful. llvm-svn: 158532
-
James Dennett authored
* Add \brief to produce a summary in the Doxygen output; * Add missing parameter names to \param commands; * Fix mismatched parameter names for \param commands; * Add a parameter name so that the \param has a target. llvm-svn: 158503
-
- Jun 12, 2012
-
-
Jordan Rose authored
This does not actually give us the right behavior for reinterpret_cast of references. Reverting so I can think about it some more. This reverts commit 50a75a6e26a49011150067adac556ef978639fe6. llvm-svn: 158341
-
Jordan Rose authored
These casts only appear in very well-defined circumstances, in which the target of a reinterpret_cast or a function formal parameter is an lvalue reference. According to the C++ standard, the following are equivalent: reinterpret_cast<T&>( x) *reinterpret_cast<T*>(&x) [expr.reinterpret.cast]p11 llvm-svn: 158338
-
- Jun 11, 2012
-
-
Chad Rosier authored
llvm-svn: 158325
-
Jordan Rose authored
While collections containing nil elements can still be iterated over in an Objective-C for-in loop, the most common Cocoa collections -- NSArray, NSDictionary, and NSSet -- cannot contain nil elements. This checker adds that assumption to the analyzer state. This was the cause of some minor false positives concerning CFRelease calls on objects in an NSArray. llvm-svn: 158319
-
Jordan Rose authored
This has a small hit in the case where only one class is interesting (NilArgChecker) but is a big improvement when looking for one of several interesting classes (VariadicMethodTypeChecker), in which the most common case is that there is no match. llvm-svn: 158318
-
- Jun 08, 2012
-
-
Anna Zaks authored
to addition. We should not to warn in case the malloc size argument is an addition containing 'sizeof' operator - it is common to use the pattern to pack values of different sizes into a buffer. Ex: uint8_t *buffer = (uint8_t*)malloc(dataSize + sizeof(length)); llvm-svn: 158219
-
Anna Zaks authored
CmpRuns.py can be used to compare issues from different analyzer runs. Since it uses the issue line number to unique 2 issues, adding a new line to the beginning of a file makes all issues in the file reported as new. The hash will be an opaque value which could be used (along with the function name) by CmpRuns to identify the same issues. This way, we only fail to identify the same issue from two runs if the function it appears in changes (not perfect, but much better than nothing). llvm-svn: 158180
-
- Jun 07, 2012
-
-
Anna Zaks authored
I falsely assumed that the memory spaces are equal when we reach this point, they might not be when memory space of one or more is stack or Unknown. We don't want a region from Heap space alias something with another memory space. llvm-svn: 158165
-
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 06, 2012
-
-
Jordan Rose authored
Patch by Guillem Marpons! llvm-svn: 158106
-
David Blaikie authored
In addition, I've made the pointer and reference typedef 'void' rather than T* just so they can't get misused. I would've omitted them entirely but std::distance likes them to be there even if it doesn't use them. This rolls back r155808 and r155869. Review by Doug Gregor incorporating feedback from Chandler Carruth. llvm-svn: 158104
-
Benjamin Kramer authored
llvm-svn: 158086
-
Ted Kremenek authored
to discover how a value was used uninitialized. llvm-svn: 158048
-
Ted Kremenek authored
adjacent edges to have compatible ranges. This simplifies the layout logic for some clients. llvm-svn: 158028
-
- Jun 04, 2012
-
-
Anna Zaks authored
This bug was triggered by r157851. It only happens in the case where we don't perform optimal diagnostic pruning. llvm-svn: 157950
-
- Jun 02, 2012
-
-
-
Anna Zaks authored
explicitly. This will make it easier to add inlining support to more expressions. llvm-svn: 157870
-
Anna Zaks authored
When we timeout or exceed a max number of blocks within an inlined function, we retry with no inlining starting from a node right before the CallEnter node. We assume the state of that node is the state of the program before we start evaluating the call. However, the node pruning removes this node as unimportant. Teach the node pruning to keep the predecessors of the call enter nodes. llvm-svn: 157860
-
Anna Zaks authored
We should not stop exploring the path after we return from an empty function. llvm-svn: 157859
-
Ted Kremenek authored
llvm-svn: 157851
-
- Jun 01, 2012
-
-
Ted Kremenek authored
llvm-svn: 157833
-
- May 31, 2012
-
-
Tom Care authored
llvm-svn: 157772
-
Anna Zaks authored
We should lock the number of elements after the initial parsing is complete. Recursive AST visitors in AnalyzesConsumer and CallGarph can trigger lazy pch deserialization resulting in more calls to HandleTopLevelDecl and appending to the LocalTUDecls list. We should ignore those. llvm-svn: 157762
-
Ted Kremenek authored
improved the pruning heuristics. The current heuristics are pretty good, but they make diagnostics for uninitialized variables warnings particularly useless in some cases. llvm-svn: 157734
-
Anna Zaks authored
Follow up in r155693, r155680. Prevents a hard to reproduce crash with the following stack trace: 3 libsystem_c.dylib 0x00007ff55a835050 _sigtramp + 18446744029881443184 4 clang 0x0000000106218e97 (anonymous namespace)::AnalysisConsumer::HandleTranslationUnit(clang::ASTContext&) + 519 5 clang 0x0000000105cf3002 clang::ParseAST(clang::Sema&, bool, bool) + 690 6 clang 0x00000001059a41d8 clang::ASTFrontendAction::ExecuteAction() + 312 7 clang 0x00000001059a3df7 clang::FrontendAction::Execute() + 231 8 clang 0x00000001059b0ecc clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 860 9 clang 0x000000010595e451 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 961 10 clang 0x0000000105947f29 cc1_main(char const**, char const**, char const*, void*) + 969 11 clang 0x0000000105958259 main + 473 12 clang 0x0000000105947b34 start + 52 llvm-svn: 157721
-
- May 27, 2012
-
-
Benjamin Kramer authored
llvm-svn: 157531
-
- May 25, 2012
-
-
Anna Zaks authored
llvm-svn: 157478
-
- May 24, 2012
- May 22, 2012
-
-
Anna Zaks authored
(ex: float). llvm-svn: 157211
-
- May 21, 2012
-
-
Benjamin Kramer authored
While there clean up indentation. llvm-svn: 157204
-
- May 19, 2012
-
-
Anna Zaks authored
llvm-svn: 157088
-