| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously, we preferred to get a result type by looking at the callee's
declared result type. This allowed us to handlereferences, which are
represented in the AST as lvalues of their pointee type. (That is, a call
to a function returning 'int &' has type 'int' and value kind 'lvalue'.)
However, this results in us preferring the original type of a function
over a casted type. This is a problem when a function pointer is casted
to another type, because the conjured result value will have the wrong
type. AdjustedReturnValueChecker is supposed to handle this, but still
doesn't handle the case where there is no "original function" at all,
i.e. where the callee is unknown.
Now, we instead look at the call expression's value kind (lvalue, xvalue,
or prvalue), and adjust the expr's type accordingly. This will have no
effect when the function is inlined, and will conjure the value that will
actually be used when it is not.
This makes AdjustedReturnValueChecker /nearly/ unnecessary; unfortunately,
the cases where it would still be useful are where we need to cast the
result of an inlined function or a checker-evaluated function, and in these
cases we don't know what we're casting /from/ by the time we can do post-
call checks. In light of that, remove AdjustedReturnValueChecker, which
was already not checking quite a few calls.
llvm-svn: 163065
|
|
|
|
|
|
|
| |
this group into "alpha" and "beta" to distinguish between checkers in
different levels of premature state.
llvm-svn: 162582
|
|
|
|
|
|
|
|
| |
The checker adds assumptions that the return values from the known APIs
are non-nil. Teach the checker about NSArray/NSMutableArray/NSOrderedSet
objectAtIndex, objectAtIndexedSubscript.
llvm-svn: 162398
|
|
|
|
|
|
|
|
|
|
|
|
| |
Instead of sprinkling dynamic type info propagation throughout
ExprEngine, the added checker would add the more precise type
information on known APIs (Ex: ObjC alloc, new) and propagate
the type info in other cases (ex: ObjC init method, casts (the second is
not implemented yet)).
Add handling of ObjC alloc, new and init to the checker.
llvm-svn: 161357
|
|
|
|
|
|
|
|
|
| |
have the time
to fix all the issues. Currently the code is essentially unmaintained and buggy, and
needs major revision (with coupled enhancements to the analyzer core).
llvm-svn: 160754
|
|
|
|
|
|
|
|
|
|
| |
This is probably not so useful yet because it is not path-sensitive, though
it does try to show inlining with indentation.
This also adds a dump() method to CallEvent, which should be useful for
debugging.
llvm-svn: 160030
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously:
...the comment said DFS...
...the WorkList being instantiated said BFS...
...and the implementation was actually DFS...
...due to an unintentional change in 2010...
...and everything kept working anyway.
This fixes our std::deque implementation of BFS, but switches back to a
SmallVector-based implementation of DFS.
We should probably still investigate the ramifications of DFS vs. BFS,
especially for large functions (and especially when we hit our block path
limit), since this might completely change our memory use. It can also mask
some bugs and reveal others depending on when we halt analysis. But at least
we will not have this kind of little mistake creep in again.
llvm-svn: 159397
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
llvm-svn: 157402
|
|
|
|
|
|
|
|
|
|
| |
The new debug.ExprInspection checker looks for calls to clang_analyzer_eval,
and emits a warning of TRUE, FALSE, or UNKNOWN (or UNDEFINED) based on the
constrained value of its (boolean) argument. It does not modify the analysis
state though the conditions tested can result in branches (e.g. through the
use of short-circuit operators).
llvm-svn: 156919
|
|
|
|
| |
llvm-svn: 156341
|
|
|
|
|
|
|
|
|
|
| |
The final graph contains a single root node, which is a parent of all externally available functions(and 'main'). As well as a list of Parentless/Unreachable functions, which are either truly unreachable or are unreachable due to our analyses imprecision.
The analyzer checkers debug.DumpCallGraph or debug.ViewGraph can be used to look at the produced graph.
Currently, the graph is not very precise, for example, it entirely skips edges resulted from ObjC method calls.
llvm-svn: 152272
|
|
|
|
|
|
|
|
|
|
|
|
| |
checks:
- unix.Malloc - Checks for memory leaks, double free, use-after-free.
- unix.cstring.NullArg - Checks for null pointers passed as arguments to
CString functions + evaluates CString functions.
- unix.cstring.BadSizeArg - Checks for common anti-patterns in
strncat size argument.
llvm-svn: 150988
|
|
|
|
| |
llvm-svn: 150306
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
| |
separately.
llvm-svn: 149947
|
|
|
|
|
|
|
| |
- osx.coreFoundation.containers.IndexOutOfBounds
- osx.cocoa.SelfInit
llvm-svn: 149747
|
|
|
|
|
|
|
| |
(Since this is syntax only, might be a good candidate for turning into a
compiler warning.)
llvm-svn: 149407
|
|
|
|
|
|
| |
from the driver.
llvm-svn: 149276
|
|
|
|
| |
llvm-svn: 149258
|
|
|
|
| |
llvm-svn: 149228
|
|
|
|
|
|
|
|
|
|
|
| |
using CFArrayCreate & family.
Specifically, CFArrayCreate's input should be:
'A C array of the pointer-sized values to be in the new array.'
(radar://10717339)
llvm-svn: 149008
|
|
|
|
|
|
| |
IdempotentOperationsChecker to the 'experimental' category. Fixes <rdar://problem/10146347>.
llvm-svn: 148533
|
|
|
|
|
|
| |
fewer than 6 Xs. Implements <rdar://problem/6336672>.
llvm-svn: 148531
|
|
|
|
|
|
|
|
|
| |
APIs. Now
multiple checks are exposed as separate checkers, but CheckerManager only creates
one Checker object.
llvm-svn: 148525
|
|
|
|
|
|
|
|
| |
called transitively
from C++ constructors or destructors. Checker by Lei Zhang with a few tweaks by Ted Kremenek.
llvm-svn: 147494
|
|
|
|
|
|
|
|
| |
between the casted type of the return value of a malloc/calloc/realloc
call and the operand of any sizeof expressions contained within
its argument(s).
llvm-svn: 146144
|
|
|
|
| |
llvm-svn: 145827
|
|
|
|
|
|
| |
The checker is responsible for defining attack surface and adding taint to symbols.
llvm-svn: 144825
|
|
|
|
| |
llvm-svn: 143787
|
|
|
|
| |
llvm-svn: 142885
|
|
|
|
|
|
|
|
|
|
| |
current analysis from CFRefCount to ExprEngine.
Remove TransferFuncs from ExprEngine and AnalysisConsumer.
Demote RetainReleaseChecker to a regular checker, and give it the name osx.cocoa.RetainCount (class name change coming shortly). Update tests accordingly.
llvm-svn: 138998
|
|
|
|
| |
llvm-svn: 137740
|
|
|
|
| |
llvm-svn: 136849
|
|
|
|
|
|
| |
be the common root package.
llvm-svn: 136835
|
|
|
|
|
|
| |
checker that may be useful for security auditing. This checker is currently too noisy to be on by default.
llvm-svn: 136804
|
|
|
|
|
|
| |
returned noErr. (+ minor cleanup)
llvm-svn: 136694
|
|
|
|
|
|
| |
experimental for now. Note, the checker still does not handle tracking of escaped values, taking into account the return value of the allocator functions, nor the actual bug reporting..
llvm-svn: 136659
|
|
|
|
|
|
| |
C++. Its external name is now unix.experimental.CString.
llvm-svn: 132958
|
|
|
|
| |
llvm-svn: 130598
|
|
|
|
|
|
| |
commit r128474.
llvm-svn: 128475
|
|
|
|
| |
llvm-svn: 128310
|
|
|
|
| |
llvm-svn: 128187
|
|
|
|
|
|
|
|
| |
variadic Objective-C methods are of Objective-C pointer types.
Ted or Argiris, I'd appreciate a review!
llvm-svn: 127572
|
|
|
|
|
|
| |
DeadStores checker into the "deadcode" group.
llvm-svn: 127531
|
|
|
|
|
|
|
|
|
| |
C++ iterators.
This checker was created by Jim Goodnow II, and I migrated it to the
new Checker interface (recent changes by Argiris).
llvm-svn: 127525
|
|
|
|
|
|
|
|
| |
They cooperate in that NSErrorChecker listens for ImplicitNullDerefEvent events that
DereferenceChecker can dispatch.
ImplicitNullDerefEvent is when we dereferenced a location that may be null.
llvm-svn: 126659
|
|
|
|
| |
llvm-svn: 126626
|
|
|
|
| |
llvm-svn: 126624
|
|
|
|
| |
llvm-svn: 126623
|