- Apr 23, 2013
-
-
Jordan Rose authored
This handles the false positive leak warning in PR15374, and also serves as a basic model for the strsep() function. llvm-svn: 180069
-
- Mar 20, 2013
-
-
Jordan Rose authored
This fixes some mistaken condition logic in RegionStore that caused global variables to be invalidated when /any/ region was invalidated, rather than only as part of opaque function calls. This was only being used by CStringChecker, and so users will now see that strcpy() and friends do not invalidate global variables. Also, add a test case we don't handle properly: explicitly-assigned global variables aren't being invalidated by opaque calls. This is being tracked by <rdar://problem/13464044>. llvm-svn: 177572
-
- Mar 16, 2013
-
-
Anna Zaks authored
Fixes a FIXME, improves dead symbol collection, suppresses a false positive, which resulted from reusing the same symbol twice for simulation of 2 calls to the same function. Fixing this lead to 2 possible false negatives in CString checker. Since the checker is still alpha and the solution will not require revert of this commit, move the tests to a FIXME section. llvm-svn: 177206
-
- Aug 24, 2012
-
-
Ted Kremenek authored
llvm-svn: 162588
-
- May 16, 2012
-
-
Jordy Rose authored
llvm-svn: 156941
-
Anna Zaks authored
This breaks the build with -triple i386-apple-darwin9. llvm-svn: 156932
-
Jordy Rose authored
llvm-svn: 156920
-
- May 14, 2012
-
-
Jordy Rose authored
We check the address of the last element accessed, but with 0 calculating that address results in element -1. This patch bails out early (and avoids a bunch of other work at that). Fixes PR12807. llvm-svn: 156769
-
- May 03, 2012
-
-
Jordy Rose authored
[analyzer] Equality ops are like relational ops in that the arguments shouldn't be converted to the result type. Fixes PR12206 and dupe PR12510. This was probably the original intent of r133041 (also me, a year ago). llvm-svn: 156062
-
- Feb 20, 2012
-
-
Anna Zaks authored
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
-
- Feb 07, 2012
-
-
Anna Zaks authored
separately. llvm-svn: 149947
-
- Jan 31, 2012
-
-
Anna Zaks authored
(Since this is syntax only, might be a good candidate for turning into a compiler warning.) llvm-svn: 149407
-
- Jan 13, 2012
-
-
Anna Zaks authored
looking up value at a CodeTextRegion even when the type is not provided. llvm-svn: 148079
-
- Dec 20, 2011
-
-
Anna Zaks authored
type is a pointer to const. (radar://10595327) The regions corresponding to the pointer and reference arguments to a function get invalidated by the calls since a function call can possibly modify the pointed to data. With this change, we are not going to invalidate the data if the argument is a pointer to const. This change makes the analyzer more optimistic in reporting errors. (Support for C, C++ and Obj C) llvm-svn: 147002
-
- Dec 11, 2011
-
-
Anna Zaks authored
[analyzer] CStringChecker should not rely on the analyzer generating UndefOrUnknown value when it cannot reason about the expression. We are now often generating expressions even if the solver is not known to be able to simplify it. This is another cleanup of the existing code, where the rest of the analyzer and checkers should not base their logic on knowing ahead of the time what the solver can reason about. In this case, CStringChecker is performing a check for overflow of 'left+right' operation. The overflow can be checked with either 'maxVal-left' or 'maxVal-right'. Previously, the decision was based on whether the expresion evaluated to undef or not. With this patch, we check if one of the arguments is a constant, in which case we know that 'maxVal-const' is easily simplified. (Another option is to use canReasonAbout() method of the solver here, however, it's currently is protected.) This patch also contains 2 small bug fixes: - swap the order of operators inside SValBuilder::makeGenericVal. - handle a case when AddeVal is unknown in GenericTaintChecker::getPointedToSymbol. llvm-svn: 146343
-
- Aug 04, 2011
-
-
Ted Kremenek authored
[analyzer] rename all experimental checker packages to have 'experimental' be the common root package. llvm-svn: 136835
-
- Jun 28, 2011
-
-
Jordy Rose authored
llvm-svn: 133994
-
- Jun 20, 2011
-
-
Jordy Rose authored
llvm-svn: 133472
-
Jordy Rose authored
[analyzer] Re-enable checking for strncpy, along with a new validation of the size argument. strncat is not yet up-to-date, but I'm leaving it enabled for now (there shouldn't be any false positives, at least...) llvm-svn: 133408
-
Jordy Rose authored
[analyzer] Eliminate "byte string function" from CStringChecker's diagnostics, and make it easier to provide custom messages for overflow checking, in preparation for re-enabling strncpy checking. llvm-svn: 133406
-
- Jun 16, 2011
-
-
Jordy Rose authored
[analyzer] Clean up modeling of strcmp, including cases where a string literal has an embedded null character, and where both arguments are the same buffer. Also use nested ifs rather than early returns; in this case early returns will lose any assumptions we've made earlier in the function. llvm-svn: 133154
-
- Jun 15, 2011
-
-
Jordy Rose authored
- (bounded copies) Be more conservative about how much is being copied. - (str(n)cat) If we can't compute the exact final length of an append operation, we can still lower-bound it. - (stpcpy) Fix the conjured return value at the end to actually be returned. This requires these supporting changes: - C string metadata symbols are still live even when buried in a SymExpr. - "Hypothetical" C string lengths, to represent a value that /will/ be passed to setCStringLength() if all goes well. (The idea is to allow for temporary constrainable symbols that may end up becoming permanent.) - The 'checkAdditionOverflow' helper makes sure that the two strings being appended in a strcat don't overflow size_t. This should never *actually* happen; the real effect is to keep the final string length from "wrapping around" in the constraint manager. This doesn't actually test the "bounded" operations (strncpy and strncat) because they can leave strings unterminated. Next on the list! llvm-svn: 133046
-
- Jun 14, 2011
-
-
Jordy Rose authored
[analyzer] CStringChecker checks functions in the C standard library, not C++. Its external name is now unix.experimental.CString. llvm-svn: 132958
-
Jordy Rose authored
[analyzer] Fix modeling of strnlen to be more conservative. Move tests we can't properly model (yet?) to string-fail.c. llvm-svn: 132955
-
- May 03, 2011
-
-
Lenny Maiorani authored
Removing strncpy() checking in CString checker for now. Some significant changes need to be made to properly support modeling of it since it potentially leaves strings non-null terminated. llvm-svn: 130758
-
- May 02, 2011
-
-
Lenny Maiorani authored
Implements strncasecmp() checker and simplifies some of the logic around creating substrings if necessary and calling the appropriate StringRef::compare/compare_lower(). llvm-svn: 130708
-
- Apr 28, 2011
-
-
Lenny Maiorani authored
llvm-svn: 130398
-
- Apr 26, 2011
-
-
Argyrios Kyrtzidis authored
Emit a -Wnull-dereference warning for "*null" not just "*null = something". Addresses rdar://9269271. llvm-svn: 130207
-
Lenny Maiorani authored
Implements the strncmp() checker just like the strcmp() checker, but with bounds. Requires LLVM svn r129582. llvm-svn: 130161
-
- Apr 15, 2011
-
-
Chris Lattner authored
Luis Felipe Strano Moraes! llvm-svn: 129559
-
- Apr 12, 2011
-
-
Lenny Maiorani authored
This patch adds modeling of strcmp() to the CString checker. Validates inputs are not NULL and are real C strings, then does the comparison and binds the proper return value. Unit tests included. llvm-svn: 129364
-
- Apr 09, 2011
-
-
Lenny Maiorani authored
Validates inputs are not NULL, checks for overlapping strings, concatenates the strings checking for buffer overflow, sets the length of the destination string to the sum of the s1 length and the s2 length, binds the return value to the s1 value. llvm-svn: 129215
-
- Mar 24, 2011
-
-
Ted Kremenek authored
llvm-svn: 128187
-
- Mar 07, 2011
-
-
Carl Norum authored
llvm-svn: 127188
-
- Feb 28, 2011
-
-
Argyrios Kyrtzidis authored
llvm-svn: 126676
-
Argyrios Kyrtzidis authored
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
-
- Feb 24, 2011
-
-
Argyrios Kyrtzidis authored
-analyzer-checker=cocoa,unix llvm-svn: 126372
-
- Feb 22, 2011
-
-
Ted Kremenek authored
llvm-svn: 126188
-
Ted Kremenek authored
llvm-svn: 126187
-
- Feb 15, 2011
-
-
Argyrios Kyrtzidis authored
CStringChecker ChrootChecker MallocChecker PthreadLockChecker StreamChecker UnreachableCodeChecker MallocChecker creates implicit dependencies between checkers and needs to be handled differently. llvm-svn: 125598
-