| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
| |
llvm-svn: 174782
|
|
|
|
|
|
|
| |
Separate the checking for the missing invalidation methods into a
separate checker so that it can be turned on/off independently.
llvm-svn: 174781
|
|
|
|
| |
llvm-svn: 174780
|
|
|
|
|
|
|
|
|
|
|
| |
The new annotation allows having methods that only partially invalidate
IVars and might not be called from the invalidation methods directly
(instead, are guaranteed to be called before the invalidation occurs).
The checker is going to trust the programmer to call the partial
invalidation method before the invalidator.This is common in cases when
partial object tear down happens before the death of the object.
llvm-svn: 174779
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The malloc checker will now catch the case when a previously malloc'ed
region is freed, but the pointer passed to free does not point to the
start of the allocated memory. For example:
int *p1 = malloc(sizeof(int));
p1++;
free(p1); // warn
From the "memory.LeakPtrValChanged enhancement to unix.Malloc" entry
in the list of potential checkers.
A patch by Branden Archer!
llvm-svn: 174678
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The checkPointerEscape callback previously did not specify how a
pointer escaped. This change includes an enum which describes the
different ways a pointer may escape. This enum is passed to the
checkPointerEscape callback when a pointer escapes. If the escape
is due to a function call, the call is passed. This changes
previous behavior where the call is passed as NULL if the escape
was due to indirectly invalidating the region the pointer referenced.
A patch by Branden Archer!
llvm-svn: 174677
|
|
|
|
|
|
|
| |
The Cnt variable is adjusted (incremented) for simplification of
checking logic. The increment should not be stored in the state.
llvm-svn: 174104
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This matches our behavior for autorelease pools created by +alloc. Some
people like to create autorelease pools in one method and release them
somewhere else.
If you want safe autorelease pool semantics, use the new ARC-compatible
syntax: @autoreleasepool { ... }
<rdar://problem/13121353>
llvm-svn: 174096
|
|
|
|
|
|
|
|
|
|
| |
The expression 'a->b.c()' contains a call to the 'c' method of 'a->b'.
We emit an error if 'a' is NULL, but previously didn't actually track
the null value back through the 'a->b' expression, which caused us to
miss important false-positive-suppression cases, including
<rdar://problem/12676053>.
llvm-svn: 173547
|
|
|
|
|
|
|
| |
This allows it to be used in places where the interesting statement
doesn't match up with the current node. No functionality change.
llvm-svn: 173546
|
|
|
|
| |
llvm-svn: 173292
|
|
|
|
|
|
|
|
|
| |
This isn't likely a full solution, but it catches the common cases
and can be refined over time.
Fixes <rdar://problem/11634353>.
llvm-svn: 173291
|
|
|
|
| |
llvm-svn: 172766
|
|
|
|
|
|
|
|
| |
it apart from [[gnu::noreturn]] / __attribute__((noreturn)), since their
semantics are not equivalent (for instance, we treat [[gnu::noreturn]] as
affecting the function type, whereas [[noreturn]] does not).
llvm-svn: 172691
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
consider (sub)module visibility.
The bulk of this change replaces myriad hand-rolled loops over the
linked list of Objective-C categories/extensions attached to an
interface declaration with loops using one of the four new category
iterator kinds:
visible_categories_iterator: Iterates over all visible categories
and extensions, hiding any that have their "hidden" bit set. This is
by far the most commonly used iterator.
known_categories_iterator: Iterates over all categories and
extensions, ignoring the "hidden" bit. This tends to be used for
redeclaration-like traversals.
visible_extensions_iterator: Iterates over all visible extensions,
hiding any that have their "hidden" bit set.
known_extensions_iterator: Iterates over all extensions, whether
they are visible to normal name lookup or not.
The effect of this change is that any uses of the visible_ iterators
will respect module-import visibility. See the new tests for examples.
Note that the old accessors for categories and extensions are gone;
there are *Raw() forms for some of them, for those (few) areas of the
compiler that have to manipulate the linked list of categories
directly. This is generally discouraged.
Part two of <rdar://problem/10634711>.
llvm-svn: 172665
|
|
|
|
|
|
| |
assignment
llvm-svn: 172597
|
|
|
|
| |
llvm-svn: 172596
|
|
|
|
| |
llvm-svn: 172595
|
|
|
|
|
|
|
|
|
|
|
| |
This was previously added to support -[NSAutoreleasePool drain], which
behaves like -release under non-GC and "please collect" under GC. We're
not currently modeling the autorelease pool stack, though, so we can
just take this out entirely.
Fixes PR14927.
llvm-svn: 172444
|
|
|
|
|
|
| |
brought into 'clang' namespace by clang/Basic/LLVM.h
llvm-svn: 172323
|
|
|
|
|
|
| |
can be fixed
llvm-svn: 172170
|
|
|
|
|
|
| |
This will get rid of some false positives as well as false negatives.
llvm-svn: 172169
|
|
|
|
| |
llvm-svn: 172168
|
|
|
|
|
|
|
|
|
|
|
|
| |
assertions.
To ensure that custom assertions/conditional would also be supported,
just check if the ivar that needs to be invalidated or set to nil is
compared against 0.
Unfortunately, this will not work for code containing 'assert(IvarName)'
llvm-svn: 172147
|
|
|
|
|
|
|
|
| |
In some cases, we just pick any ivar that needs invalidation and attach
the warning to it. Picking the first from DenseMap of pointer keys was
triggering non-deterministic output.
llvm-svn: 172134
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Restructured the checker so that it could easily find two new classes of
issues:
- when a class contains an invalidatable ivar, but no declaration of an
invalidation method
- when a class contains an invalidatable ivar, but no definition of an
invalidation method in the @implementation.
The second case might trigger some false positives, for example, when
the method is defined in a category.
llvm-svn: 172104
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The issue here is that if we have 2 leaks reported at the same line for
which we cannot print the corresponding region info, they will get
treated as the same by issue_hash+description. We need to AUGMENT the
issue_hash with the allocation info to differentiate the two issues.
Add the "hash" (offset from the beginning of a function) representing
allocation site to solve the issue.
We might want to generalize solution in the future when we decide to
track more than just the 2 locations from the diagnostics.
llvm-svn: 171825
|
|
|
|
|
|
|
|
|
| |
Better handle the blacklisting of known bad deallocators when symbol
escapes through a call to CFStringCreateWithBytesNoCopy.
Addresses radar://12702952.
llvm-svn: 171770
|
|
|
|
|
|
|
|
|
| |
When a property is "inherited" through both a parent class and directly
through a protocol, we should not require the child to invalidate it
since the backing ivar belongs to the parent class.
(Fixes radar://12913734)
llvm-svn: 171769
|
|
|
|
|
|
|
|
|
|
| |
actually include it's name.
This is a possible regression of moving to using ImplicitNullDerefEvent.
Fixing this for real (including the parameter name) requires more
plumbing in ImplicitNullDerefEvent. This is just a stop gap fix.
llvm-svn: 171502
|
|
|
|
| |
llvm-svn: 171501
|
|
|
|
| |
llvm-svn: 171439
|
|
|
|
|
|
|
| |
This better reflects when callback is called and what the checkers
are relying on. (Both names meant the same pre-IPA.)
llvm-svn: 171432
|
|
|
|
|
|
|
|
| |
objc_no_direct_instance_variable_assignment.
Fixes <rdar://problem/12927551>.
llvm-svn: 170971
|
|
|
|
|
|
| |
The new callback greatly simplifies the checker.
llvm-svn: 170969
|
|
|
|
| |
llvm-svn: 170832
|
|
|
|
|
|
| |
Fixes <rdar://problem/12887356>.
llvm-svn: 170724
|
|
|
|
|
|
|
|
|
|
| |
Instead of using several callbacks to identify the pointer escape event,
checkers now can register for the checkPointerEscape.
Converted the Malloc checker to use the new callback.
SimpleStreamChecker will be converted next.
llvm-svn: 170625
|
|
|
|
|
|
| |
of the include guards.
llvm-svn: 170364
|
|
|
|
|
|
| |
Thanks for the -Wdocumentation catch, Dmitri!
llvm-svn: 170139
|
|
|
|
|
|
|
|
| |
We now check a few methods for UIResponder, NSResponder, and NSDocument.
Patch by Julian Mayer!
llvm-svn: 170089
|
|
|
|
|
|
|
|
|
|
|
| |
This is a Band-Aid fix to a false positive, where we complain about not
initializing self to [super init], where self is not coming from the
init method, but is coming from the caller to init.
The proper solution would be to associate the self and it's state with
the enclosing init.
llvm-svn: 170059
|
|
|
|
|
|
|
|
|
| |
inlined.
Fixes a false positive that occurs if a user writes their own
initWithBytesNoCopy:freeWhenDone wrapper.
llvm-svn: 169795
|
|
|
|
|
|
|
|
|
| |
Previously we made three passes over the set of dead symbols, and removed
them from the state /twice/. Now we combine the autorelease pass and the
symbol death pass, and only have to remove the bindings for the symbols
that leaked.
llvm-svn: 169527
|
|
|
|
|
|
|
|
| |
referenced_vars_iterator.
This is a nice conceptual cleanup.
llvm-svn: 169480
|
|
|
|
| |
llvm-svn: 169478
|
|
|
|
| |
llvm-svn: 169365
|
|
|
|
|
|
|
| |
This will only check the direct ivar assignments in the annotated
methods.
llvm-svn: 169349
|
|
|
|
| |
llvm-svn: 169318
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
uncovered.
This required manually correcting all of the incorrect main-module
headers I could find, and running the new llvm/utils/sort_includes.py
script over the files.
I also manually added quite a few missing headers that were uncovered by
shuffling the order or moving headers up to be main-module-headers.
llvm-svn: 169237
|