summaryrefslogtreecommitdiffstats
path: root/clang/test/Analysis
Commit message (Collapse)AuthorAgeFilesLines
...
* Removed IdempotentOperationChecker from default analysis and returned back ↵Tom Care2010-08-062-2/+2
| | | | | | | | | to a flag (-analyzer-check-idempotent-operations) - Added IdempotentOperationChecker to experimental analyses for testing purposes - Updated test cases to explictly call the checker llvm-svn: 110482
* add test case.Zhongxing Xu2010-08-061-0/+4
| | | | llvm-svn: 110408
* When checking if a buffer access is valid, first make sure the buffer has a ↵Jordy Rose2010-08-051-0/+6
| | | | | | valid Loc. Fixes PR7830. llvm-svn: 110390
* Fixed logic error in UnreachableCodeChecker's marking algorithm that would ↵Tom Care2010-08-051-0/+14
| | | | | | sometimes allow for multiple sequential statements to be flagged. llvm-svn: 110353
* Correctly handle 'Class<...>' when examining Cocoa conventions in the static ↵Ted Kremenek2010-08-051-0/+9
| | | | | | analyzer. Fixes a crash reported in <rdar://problem/8272168>. Patch by Henry Mason! llvm-svn: 110289
* Teach SemaChecking::CheckReturnStackAddr about ImplicitCastExprs that ↵Ted Kremenek2010-08-041-0/+8
| | | | | | convert values to an lvalue. This allows us to warn (again) about returning references to stack variables. (fixes PR 7812). llvm-svn: 110242
* Fix idempotent operations false positive caused by ivars not being ↵Ted Kremenek2010-08-021-0/+27
| | | | | | | | invalidated in function calls when the enclosing object had retain/release state. Fixes <rdar://problem/8261992>. llvm-svn: 110068
* Add test case for <rdar://problem/8258814>.Ted Kremenek2010-08-021-0/+9
| | | | llvm-svn: 110058
* Improve flat store: MemRegion::getAsOffset() computes a region's offset withinZhongxing Xu2010-08-021-0/+11
| | | | | | | | the top-level object. FlatStore now can bind and retrieve element and field regions. PR7297 is fixed by flat store. llvm-svn: 110020
* Only run the jump-checker if there's a branch-protected scope *and* there'sJohn McCall2010-08-011-0/+1
| | | | | | | | | | a switch or goto somewhere in the function. Indirect gotos trigger the jump-checker regardless, because the conditions there are slightly more elaborate and it's too marginal a case to be worth optimizing. Turns off the jump-checker in a lot of cases in C++. rdar://problem/7702918 llvm-svn: 109962
* After a lengthy design discussion, add support for "ownership attributes" ↵Ted Kremenek2010-07-311-4/+118
| | | | | | for malloc/free checking. Patch by Andrew McGregor! llvm-svn: 109939
* Test case for PR7763.Tom Care2010-07-301-0/+14
| | | | llvm-svn: 109895
* Move new test (that requires RegionStore) into its own file.Jordy Rose2010-07-292-23/+25
| | | | llvm-svn: 109736
* Use a LazyCompoundVal to handle initialization with a string literal, rather ↵Jordy Rose2010-07-291-0/+23
| | | | | | than copying each character. llvm-svn: 109734
* Teach GRExprEngine::VisitLValue() about FloatingLiteral, ImaginaryLiteral, ↵Ted Kremenek2010-07-291-0/+16
| | | | | | and CharacterLiteral. Fixes an assertion failure reported in PR 7675. llvm-svn: 109719
* Augment RegionStore::BindStruct() to bind symbolicated struct values. This ↵Ted Kremenek2010-07-292-1/+17
| | | | | | fixes a false path issue reported in <rdar://problem/8243408> and also spurs another cause where the idempotent operations checker fires. llvm-svn: 109710
* Added some false positive checking to UnreachableCodeCheckerTom Care2010-07-275-56/+85
| | | | | | | | | - Allowed reporting of dead macros - Added path walking function to search for false positives in conditional statements - Updated some affected tests - Added some false positive test cases llvm-svn: 109561
* Finesse 'idempotent operations' analyzer issues to include the opcode of the ↵Ted Kremenek2010-07-277-44/+44
| | | | | | binary operator for clearer error reporting. Also remove the 'Idempotent operation' prefix in messages; it's redundant since the bug type is the same. llvm-svn: 109527
* Don't warn about unreachable code if the block starts with ↵Jordy Rose2010-07-271-0/+6
| | | | | | | | __builtin_unreachable(). The next step is to warn if a block labeled unreachable is, in fact, reachable. Somewhat related to PR810. llvm-svn: 109487
* Groundwork for C string length tracking. Currently only handles the length ↵Jordy Rose2010-07-271-0/+65
| | | | | | of constant string literals, which is not too helpful, and only calls to strlen() are checked. llvm-svn: 109480
* Added an path-sensitive unreachable code checker to the experimental ↵Tom Care2010-07-234-17/+72
| | | | | | | | | | analyzer checks. - Created a new class to do post-analysis - Updated several test cases with unreachable code to expect a warning - Added some general tests llvm-svn: 109286
* Add FILE* leak check to StreamChecker. Patch by Lei Zhang.Zhongxing Xu2010-07-231-0/+21
| | | | llvm-svn: 109225
* This patch adds support for tmpfile in StreamChecker. Patch by Lei Zhang.Zhongxing Xu2010-07-221-0/+6
| | | | llvm-svn: 109106
* fix test case.Zhongxing Xu2010-07-191-1/+1
| | | | llvm-svn: 108671
* Add double close check to StreamChecker. Patch by Lei Zhang.Zhongxing Xu2010-07-191-0/+7
| | | | llvm-svn: 108669
* Fix '<rdar://problem/8202272> __imag passed non-complex should not crash' by ↵Ted Kremenek2010-07-171-0/+6
| | | | | | removing a bogus assertion. llvm-svn: 108602
* Fix APFloat assertion failure in IdempotentOperationChecker resulting in havingTed Kremenek2010-07-171-0/+6
| | | | | | an APFloat with different "float semantics" than the compared float literal. llvm-svn: 108590
* Improved false positive rate for the idempotent operations checker and moved ↵Tom Care2010-07-167-15/+15
| | | | | | | | | | it into the default path-sensitive analysis options. - Added checks for static local variables, self assigned parameters, and truncating/extending self assignments - Removed command line option (now default with --analyze) - Updated test cases to pass with idempotent operation warnings llvm-svn: 108550
* fix PR7280 by making the warning on code like this:Chris Lattner2010-07-111-4/+4
| | | | | | | | | | int test1() { return; } default to an error. llvm-svn: 108108
* Cleanup in CStringChecker. Now properly bifurcates the state for ↵Jordy Rose2010-07-081-0/+8
| | | | | | zero/nonzero sizes. llvm-svn: 107935
* Add memcmp() and bcmp() to CStringChecker. These check for valid access to ↵Jordy Rose2010-07-071-2/+68
| | | | | | the buffer arguments and have a special-case for when the buffer arguments are known to be the same address, or when the size is zero. llvm-svn: 107761
* Cleanup on CStringChecker and its associated tests. Also check for null ↵Jordy Rose2010-07-071-13/+29
| | | | | | arguments...which are allowed if the access length is 0! llvm-svn: 107759
* implement PR7569, warning about assignment to null, which Chris Lattner2010-07-071-1/+1
| | | | | | | | people seem to write when they want a deterministic trap. Suggest instead that they use a volatile pointer or __builtin_trap. llvm-svn: 107756
* Fix idempotent operations test command line arguments.Tom Care2010-07-061-1/+1
| | | | llvm-svn: 107735
* Add a new path-sensitive checker for functions in <string.h>, for both ↵Jordy Rose2010-07-061-0/+187
| | | | | | null-terminated strings and memory blocks. Currently only checks memcpy(), memmove(), and bcopy(), but this is intended to be expanded soon. llvm-svn: 107722
* Added a path-sensitive idempotent operation checker ↵Tom Care2010-07-061-0/+52
| | | | | | | | | | | | | | | | | | | (-analyzer-idempotent-operation). Finds idempotent and/or tautological operations in a path sensitive context, flagging operations that have no effect or a predictable effect. Example: { int a = 1; int b = 5; int c = b / a; // a is 1 on all paths } - New IdempotentOperationChecker class - Moved recursive Stmt functions in r107675 to IdempotentOperationChecker - Minor refactoring of SVal to allow checking for any integer - Added command line option for check - Added basic test cases llvm-svn: 107706
* Oops, tabs --> spaces in test.Jordy Rose2010-07-061-10/+10
| | | | llvm-svn: 107634
* Improve NULL-checking for CFRetain/CFRelease. We now remember that the ↵Jordy Rose2010-07-061-0/+14
| | | | | | argument was non-NULL, and we report where the null assumption came from (like AttrNonNullChecker already did). llvm-svn: 107633
* Support sizeof for VLA expressions (sizeof(someVLA)). sizeof(int[n]) still ↵Jordy Rose2010-07-051-0/+9
| | | | | | unimplemented. A VLA region's sizeof value matches its extent. llvm-svn: 107611
* Track extents for VLAs.Jordy Rose2010-07-051-0/+8
| | | | llvm-svn: 107603
* Add a new symbol type, SymbolExtent, to represent the extents of memory ↵Jordy Rose2010-07-043-1/+17
| | | | | | | | | | regions that may not be known at compile-time (such as those created by malloc). This replaces the old setExtent/getExtent API on Store, which used the GRState's GDM to store SVals. Also adds a getKnownValue() method to SValuator, which gets the integer value of an SVal if it is known to only have one possible value. There are more places in the code that could be using this, but in general we want to be dealing entirely in SVals, so its usefulness is limited. The only visible functionality change is that extents are now honored for any DeclRegion, such as fields and Objective-C ivars, rather than just variables. This shows up in bounds-checking and cast-size-checking. llvm-svn: 107577
* Fix PR 7475 by enhancing the static analyzer to also invalidate bindings for ↵Ted Kremenek2010-07-011-0/+21
| | | | | | | | | | | non-static global variables when calling a function/method whose impact on global variables we cannot accurately estimate. This change introduces two new MemSpaceRegions that divide up the memory space of globals, and causes RegionStore and BasicStore to consult a binding to the NonStaticGlobalsMemSpaceRegion when lazily determining the value of a global. llvm-svn: 107423
* Fix rdar://8139785 "implement warning on dead expression in comma operator"Argyrios Kyrtzidis2010-06-301-2/+2
| | | | | | | | | | As a bonus, fix the warning for || and && operators; it was emitted even if one of the operands had side effects, e.g: x || test_logical_foo1(); emitted a bogus "expression result unused" for 'x'. llvm-svn: 107274
* Pointers casted as integers still count as locations to SimpleSValuator, so ↵Jordy Rose2010-06-301-0/+5
| | | | | | don't crash if we do a funny thing like ((int)ptr)&1. Fixes PR7527. llvm-svn: 107236
* Pointer comparisons (and pointer-pointer subtraction). Basically filling in ↵Jordy Rose2010-06-282-0/+232
| | | | | | SimpleSValuator::EvalBinOpLL(). llvm-svn: 106992
* Implicitly compare symbolic expressions to zero when they're being used as ↵Jordy Rose2010-06-271-0/+18
| | | | | | constraints. Part of PR7491. llvm-svn: 106972
* When a constant size array is casted to another type, its length should be ↵Jordy Rose2010-06-252-0/+12
| | | | | | scaled as well. llvm-svn: 106911
* Add dead stores C++ test case that was previously asserting due to anTed Kremenek2010-06-251-0/+8
| | | | | | invalid source range for CXXNewExpr. llvm-svn: 106904
* Fix -analyze-display-progress (once again), this time with an additional ↵Ted Kremenek2010-06-251-0/+9
| | | | | | regression test. llvm-svn: 106883
* A bug I've introduced in STDIN handling surfaced a few broken tests, fix them.Benjamin Kramer2010-06-251-2/+2
| | | | | | Lexer/hexfloat.cpp is now XFAIL'd, I'd appreciate if someone could look into it. llvm-svn: 106840
OpenPOWER on IntegriCloud