| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
| |
Richard rejected my Sema change to interpret an integer literal zero in
a varargs context as a null pointer, so -Wsentinel sees an integer
literal zero and fires off a warning. Only CodeGen currently knows that
it promotes integer literal zeroes in this context to pointer size on
Windows. I didn't want to teach -Wsentinel about that compatibility
hack. Therefore, I'm migrating to C++11 nullptr.
llvm-svn: 223079
|
|
|
|
| |
llvm-svn: 221217
|
|
|
|
|
|
| |
package.
llvm-svn: 220289
|
|
|
|
|
|
|
|
|
|
|
| |
allocate a bunch of any pointer type.
This suppresses a common false positive when analyzing libc++.
Along the way, introduce some tests to show this checker actually
works with C++ static_cast<>.
llvm-svn: 220160
|
|
|
|
|
|
| |
Patch by Daniel Fahlgren!
llvm-svn: 219625
|
|
|
|
| |
llvm-svn: 219031
|
|
|
|
|
|
|
|
|
|
| |
There are three copies of IsCompleteType(...) functions in CSA and all
of them are incomplete (I experienced crashes in some CSA's test cases).
I have replaced these function calls with Type::isIncompleteType() calls.
A patch by Aleksei Sidorin!
llvm-svn: 219026
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The MallocChecker does currently not track the memory allocated by
if_nameindex. That memory is dynamically allocated and should be freed
by calling if_freenameindex. The attached patch teaches the checker
about these functions.
Memory allocated by if_nameindex is treated as a separate allocation
"family". That way the checker can verify it is freed by the correct
function.
A patch by Daniel Fahlgren!
llvm-svn: 219025
|
|
|
|
|
|
|
|
|
|
| |
The return value of mempcpy is only correct when the destination type is
one byte in size. This patch casts the argument to a char* so the
calculation is also correct for structs, ints etc.
A patch by Daniel Fahlgren!
llvm-svn: 219024
|
|
|
|
|
|
| |
No functionality change.
llvm-svn: 217586
|
|
|
|
|
|
| |
Patch by Daniel Fahlgren!
llvm-svn: 217461
|
|
|
|
|
|
| |
Patch by Daniel Fahlgren!
llvm-svn: 217258
|
|
|
|
| |
llvm-svn: 217205
|
|
|
|
| |
llvm-svn: 216751
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
the no-arguments case. Don't expand this to an __attribute__((nonnull(A, B,
C))) attribute, since that does the wrong thing for function templates and
varargs functions.
In passing, fix a grammar error in the diagnostic, a crash if
__attribute__((nonnull(N))) is applied to a varargs function,
a bug where the same null argument could be diagnosed multiple
times if there were multiple nonnull attributes referring to it,
and a bug where nonnull attributes would not be accumulated correctly
across redeclarations.
llvm-svn: 216520
|
|
|
|
|
|
|
|
|
| |
The ObjCDealloc checker is currently disabled because it was too aggressive, but this
is a good first step in getting it back to a useful state.
Patch by David Kilzer!
llvm-svn: 216272
|
|
|
|
|
|
|
| |
to +initilize as this results in an extra call
to this method. rdar://16628028
llvm-svn: 216271
|
|
|
|
|
|
|
| |
The call will never go to a more derived class, but that's intentional in those
cases.
llvm-svn: 216167
|
|
|
|
|
|
|
|
| |
an integer.
Patch by Daniel Fahlgren.
llvm-svn: 216079
|
|
|
|
|
|
| |
Patch by Daniel Fahlgren.
llvm-svn: 216078
|
|
|
|
|
|
|
|
| |
different widths.
PR20659. Patch by Anders Rönnholm.
llvm-svn: 216076
|
|
|
|
|
|
|
|
| |
string literals.
PR20693. Patch by Anders Rönnholm.
llvm-svn: 216075
|
|
|
|
|
|
| |
Modifications made by clang-tidy with minor tweaks.
llvm-svn: 215557
|
|
|
|
|
|
|
|
| |
array.
Patch by Daniel Fahlgren!
llvm-svn: 215456
|
|
|
|
|
|
| |
Newly-created unconsumed instance is now assumed escaped if an invoked constructor has an argument of a pointer-to-record type.
llvm-svn: 214909
|
|
|
|
|
|
| |
msc17.
llvm-svn: 212789
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
denominator.
This new checker, alpha.core.TestAfterDivZero, catches issues like this:
int sum = ...
int avg = sum / count; // potential division by zero...
if (count == 0) { ... } // ...caught here
Because the analyzer does not necessarily explore /all/ paths through a program,
this check is restricted to only work on zero checks that immediately follow a
division operation (/ % /= %=). This could later be expanded to handle checks
dominated by a division operation but not necessarily in the same CFG block.
Patch by Anders Rönnholm! (with very minor modifications by me)
llvm-svn: 212731
|
|
|
|
| |
llvm-svn: 212369
|
|
|
|
|
|
| |
Patch by Sean McBride, tests adjusted by me.
llvm-svn: 211453
|
|
|
|
|
|
|
|
|
| |
Fixes a crash in Retain Count checker error reporting logic by handing
the allocation statement retrieval from a BlockEdge program point.
Also added a simple CFG dump routine for debugging.
llvm-svn: 210960
|
|
|
|
|
|
| |
be performed by using Decl::isInStdNamespace or DeclContext::isStdNamespace
llvm-svn: 209708
|
|
|
|
| |
llvm-svn: 209642
|
|
|
|
|
|
|
| |
Based on a patch by jfcaron3@gmail.com!
PR19806
llvm-svn: 209215
|
|
|
|
| |
llvm-svn: 208838
|
|
|
|
|
|
| |
Found by LSan.
llvm-svn: 208251
|
|
|
|
|
|
| |
Follow-up to Nico's leak-stopping patch in r208110.
llvm-svn: 208155
|
|
|
|
|
|
|
|
| |
BugReport doesn't take ownership of the bug type, so let the checker own the
the bug type. (Requires making the bug type mutable, which is icky, but which
is also what other checkers do.)
llvm-svn: 208110
|
|
|
|
|
|
| |
range accessor in addition to the iterators. Updated code using iterators to use range-based for loops.
llvm-svn: 207837
|
|
|
|
|
|
|
|
|
|
| |
definition below all of the header #include lines, clang edition.
If you want more details about this, you can see some of the commits to
Debug.h in LLVM recently. This is just the clang section of a cleanup
I've done for all uses of DEBUG_TYPE in LLVM.
llvm-svn: 206849
|
|
|
|
| |
llvm-svn: 205828
|
|
|
|
|
|
|
|
|
|
| |
This also includes some infrastructure to make it easier to build multi-argument
selectors, rather than trying to use string matching on each piece. There's a bit
more setup code, but less cost at runtime.
PR18908
llvm-svn: 205827
|
|
|
|
|
|
|
|
| |
destroyed lock.
Patch by Daniel Fahlgren!
llvm-svn: 205276
|
|
|
|
|
|
| |
Patch by Daniel Fahlgren!
llvm-svn: 205275
|
|
|
|
|
|
|
|
|
| |
We've decided to punt on supporting recursive locks for now; the common case
is non-recursive.
Patch by Daniel Fahlgren!
llvm-svn: 205274
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add M_ZERO awareness to malloc() static analysis in Clang for FreeBSD,
NetBSD, and OpenBSD in a similar fashion to O_CREAT for open(2).
These systems have a three-argument malloc() in the kernel where the
third argument contains flags; the M_ZERO flag will zero-initialize the
allocated buffer.
This should reduce the number of false positives when running static
analysis on BSD kernels.
Additionally, add kmalloc() (Linux kernel malloc()) and treat __GFP_ZERO
like M_ZERO on Linux.
Future work involves a better method of checking for named flags without
hardcoding values.
Patch by Conrad Meyer, with minor modifications by me.
llvm-svn: 204832
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
A refinement of r198953 to handle cases where an object is accessed both through
a property getter and through direct ivar access. An object accessed through a
property should always be treated as +0, i.e. not owned by the caller. However,
an object accessed through an ivar may be at +0 or at +1, depending on whether
the ivar is a strong reference. Outside of ARC, we don't have that information,
so we just don't track objects accessed through ivars.
With this change, accessing an ivar directly will deliberately override the +0
provided by a getter, but only if the +0 hasn't participated in other retain
counting yet. That isn't perfect, but it's already unusual for people to be
mixing property access with direct ivar access. (The primary use case for this
is in setters, init methods, and -dealloc.)
Thanks to Ted for spotting a few mistakes in private review.
<rdar://problem/16333368>
llvm-svn: 204730
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
found with a smarter version of -Wunused-member-function that I'm playwing with.
Appologies in advance if I removed someone's WIP code.
ARCMigrate/TransProperties.cpp | 8 -----
AST/MicrosoftMangle.cpp | 1
Analysis/AnalysisDeclContext.cpp | 5 ---
Analysis/LiveVariables.cpp | 14 ----------
Index/USRGeneration.cpp | 10 -------
Sema/Sema.cpp | 33 +++++++++++++++++++++---
Sema/SemaChecking.cpp | 3 --
Sema/SemaDecl.cpp | 20 ++------------
StaticAnalyzer/Checkers/GenericTaintChecker.cpp | 1
9 files changed, 34 insertions(+), 61 deletions(-)
llvm-svn: 204561
|
|
|
|
|
|
| |
class.
llvm-svn: 203999
|
|
|
|
|
|
| |
iterator_range decls(). Updating all of the usages of the iterators with range-based for loops.
llvm-svn: 203947
|
|
|
|
|
|
| |
propimpl_end() with iterator_range property_impls(). Updating all of the usages of the iterators with range-based for loops.
llvm-svn: 203930
|