summaryrefslogtreecommitdiffstats
path: root/clang/test/Analysis/null-deref-ps.c
Commit message (Collapse)AuthorAgeFilesLines
...
* Enhance null dereference diagnostics by indicating what variable (if any) ↵Ted Kremenek2009-11-241-4/+4
| | | | | | was dereferenced. Addresses <rdar://problem/7039161>. llvm-svn: 89726
* Switch -f{builtin,math-errno,rtti} and -analyzer-purge-dead to -...no... ↵Daniel Dunbar2009-11-191-1/+1
| | | | | | variants instead of using llvm::cl::init(true) arguments. llvm-svn: 89315
* Add clang-cc option "--analyzer-experimental-internal-checks". ThisTed Kremenek2009-11-131-4/+4
| | | | | | | option enables new "internal" checks that will eventually be turned on by default but still require broader testing. llvm-svn: 88671
* Eliminate &&s in tests.Daniel Dunbar2009-11-081-3/+3
| | | | | | - 'for i in $(find . -type f); do sed -e 's#\(RUN:.*[^ ]\) *&& *$#\1#g' $i | FileUpdate $i; done', for the curious. llvm-svn: 86430
* Remove test case's dependency on platform headers.Ted Kremenek2009-09-281-6/+12
| | | | llvm-svn: 83030
* Add test case for PR 4759.Ted Kremenek2009-08-241-0/+9
| | | | llvm-svn: 79954
* Remove 'StoreManager::OldCastRegion()', TypedViewRegion (which onlyTed Kremenek2009-07-291-2/+0
| | | | | | | OldCastRegion used), and the associated command line option '-analyzer-store=old-basic-cast'. llvm-svn: 77509
* Prep for new warning.Mike Stump2009-07-221-1/+1
| | | | llvm-svn: 76813
* Migrate the path-sensitive checking of 'nonnull' arguments over to the newTed Kremenek2009-07-221-0/+9
| | | | | | | | | 'Checker' interface. An updated test case illustrates that after calling a function with the 'nonnull' attribute we now register the fact that the passed pointer must be non-null. This retention of information was not possible with the previously used GRSimpleAPICheck interface. llvm-svn: 76797
* Prep for new warning.Mike Stump2009-07-211-1/+2
| | | | llvm-svn: 76610
* Switch BasicStoreManager to use the new CastRegion implementation by default,Ted Kremenek2009-07-101-2/+2
| | | | | | | | and replace the 'clang-cc' option '-analyzer-store=basic-new-cast' with '-analyzer-store=basic-old-cast'. We'll keep the old CastRegion implementation around for a little while for regression testing. llvm-svn: 75209
* Make 'BasicStoreManager' + 'NewCastRegion' testable from the command line ↵Ted Kremenek2009-07-061-0/+2
| | | | | | using '-analyzer-store=basic-new-cast'. llvm-svn: 74865
* Introduce a new concept to the static analyzer: SValuator.Ted Kremenek2009-06-261-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | GRTransferFuncs had the conflated role of both constructing SVals (symbolic expressions) as well as handling checker-specific logic. Now SValuator has the role of constructing SVals from expressions and GRTransferFuncs just handles checker-specific logic. The motivation is by separating these two concepts we will be able to much more easily create richer constraint-generating logic without coupling it to the main checker transfer function logic. We now have one implementation of SValuator: SimpleSValuator. SimpleSValuator is essentially the SVal-related logic that was in GRSimpleVals (which is removed in this patch). This includes the logic for EvalBinOp, EvalCast, etc. Because SValuator has a narrower role than the old GRTransferFuncs, the interfaces are much simpler, and so is the implementation of SimpleSValuator compared to GRSimpleVals. I also did a line-by-line review of SVal-related logic in GRSimpleVals and cleaned it up while moving it over to SimpleSValuator. As a consequence of removing GRSimpleVals, there is no longer a '-checker-simple' option. The '-checker-cfref' did everything that option did but also ran the retain/release checker. Of course a user may not always wish to run the retain/release checker, nor do we wish core analysis logic buried in the checker-specific logic. The next step is to refactor the logic in CFRefCount.cpp to separate out these pieces into the core analysis engine. llvm-svn: 74229
* Fix false positive null dereference by unifying code paths in GRSimpleVals forTed Kremenek2009-05-041-3/+3
| | | | | | | '==' and '!=' (some code in the '!=' was not replicated in the '==' code, causing some constraints to get lost). llvm-svn: 70885
* Update test case.Ted Kremenek2009-05-041-0/+29
| | | | llvm-svn: 70883
* Add another null pointer check test case.Ted Kremenek2009-05-021-0/+14
| | | | llvm-svn: 70614
* Warn about invalid return statements by default.Steve Naroff2009-04-301-2/+2
| | | | | | | | This fixes <rdar://problem/6839489> 10A345: Clang does not warm about mismatched returns (void return from a bool function) Will implement -Wreturn-type, -Wno-return-type in another commit. llvm-svn: 70492
* Rename clang to clang-cc.Daniel Dunbar2009-03-241-4/+4
| | | | | | Tests and drivers updated, still need to shuffle dirs. llvm-svn: 67602
* GRExprEngine: Polish up handling of casting integer constants to pointers ↵Ted Kremenek2009-03-051-0/+7
| | | | | | and back. llvm-svn: 66127
* Static Analyzer driver/options (partial) cleanup:Ted Kremenek2009-02-171-3/+3
| | | | | | | | | | | | | | - Move all analyzer options logic to AnalysisConsumer.cpp. - Unified specification of stores/constraints/output to be: -analyzer-output=... -analyzer-store=... -analyzer-constraints=... instead of -analyzer-range-constraints, -analyzer-store-basic, etc. - Updated drivers (ccc-analyzer, scan-builds, new ccc) to obey this new interface - Updated test cases to conform to new driver options llvm-svn: 64737
* Test passes with -analyzer-range-contraints.Ted Kremenek2009-02-161-0/+1
| | | | llvm-svn: 64663
* Put the region store specific test in a separate file.Zhongxing Xu2009-02-061-9/+0
| | | | llvm-svn: 63930
* Create ElementRegion when the base is SymbolicRegion. This is like what we doZhongxing Xu2009-02-061-0/+9
| | | | | | | | | for FieldRegion. This enables us to track more values. Simplify SymbolicRegion::getRValueType(). We assume the symbol always has pointer type. llvm-svn: 63928
* Enhance test case to test RegionStore with -checker-cfref.Ted Kremenek2009-01-221-1/+2
| | | | llvm-svn: 62801
* Add -analyze action to run static analyzer, instead of inferring fromDaniel Dunbar2009-01-201-2/+2
| | | | | | individual checker options. llvm-svn: 62634
* Fix analyzer crash found when scanning Wine sources where the analyzer used ↵Ted Kremenek2009-01-171-0/+23
| | | | | | old logic to determine the value of a switch 'case' label. llvm-svn: 62395
* static analyzer: Handle casts from arrays to integers. This fixes PR 3297.Ted Kremenek2009-01-131-0/+21
| | | | llvm-svn: 62130
* Add an option to make 'RemoveDeadBindings' a configurable behavior. This enablesZhongxing Xu2008-12-221-2/+2
| | | | | | us to measure the effect of this optimization. llvm-svn: 61319
* Lazy bingding for region-store manager.Zhongxing Xu2008-12-201-2/+2
| | | | | | | | | | | | | * Now Bind() methods take and return GRState* because binding could also alter GDM. * No variables are initialized except those declared with initial values. * failed C test cases are due to bugs in RemoveDeadBindings(), which removes constraints that is still alive. This will be fixed in later patch. * default value of array and struct regions will be implemented in later patch. llvm-svn: 61274
* Add 'expected-warning' to make test case pass.Ted Kremenek2008-12-041-2/+2
| | | | llvm-svn: 60548
* Add another static analyzer test case involving attribute(nonnull).Ted Kremenek2008-12-041-0/+5
| | | | llvm-svn: 60547
* Add another test case for attribute(nonnull) checking.Ted Kremenek2008-12-041-0/+9
| | | | llvm-svn: 60544
* BasicConstraintManager:Ted Kremenek2008-12-031-0/+9
| | | | | | | | | | | - Fix nonsensical logic in AssumeSymGE. When comparing 'sym >= constant' and the constant is the maximum integer value, add the constraint that 'sym == constant' when the path is deemed feasible. All other cases are feasible. - Improve AssumeSymGT. When comparing 'sym > constant' and constant is the maximum integer value we know the path is infeasible. - Add test case for this enhancement to AssumeSymGT. llvm-svn: 60490
* BasicConstraintManager:Ted Kremenek2008-12-031-0/+10
| | | | | | | | | | | | - Fix nonsensical logic in AssumeSymLE. When comparing 'sym <= constant' and the constant is the minimum integer value, add the constraint that 'sym == constant' when the path is deemed feasible. All other cases are feasible. - Improve AssumeSymLT to address <rdar://problem/6407949>. When comparing 'sym < constant' and constant is the minimum integer value we know the path is infeasible. - Add test case for <rdar://problem/6407949>. llvm-svn: 60489
* Add a test case for compound assignments that lazily symbolicate the value ↵Ted Kremenek2008-11-151-0/+20
| | | | | | of the LHS when the computation type is an integer of more bits. llvm-svn: 59352
* Add && to test command.Zhongxing Xu2008-11-111-1/+1
| | | | llvm-svn: 59014
* Add region store model to path-sensitive testing.Zhongxing Xu2008-11-101-0/+1
| | | | llvm-svn: 58983
* This test now passes again.Ted Kremenek2008-10-171-1/+0
| | | | llvm-svn: 57742
* Mark these tests XFAIL. We need to add back assumption logic when doing ↵Ted Kremenek2008-10-171-0/+1
| | | | | | array and field accesses. llvm-svn: 57658
* Updated test case.Ted Kremenek2008-09-241-3/+5
| | | | llvm-svn: 56548
* Fixed logic error in BasicConstraintManager pointed out by Zhongxing Xu.Ted Kremenek2008-09-191-4/+4
| | | | | | | | | | | | | | | For checking if a symbol >= value, we need to check if symbol == value || symbol > value. When checking symbol > value and we know that symbol != value, the path is infeasible only if value == maximum integer. For checking if a symbol <= value, we need to check if symbol == value || symbol < value. When checking symbol < value and we know that symbol != value, the path is infeasible only if value == minimum integer. Updated test case exercising this logic: we only prune paths if the values are unsigned. llvm-svn: 56354
* Add path-sensitivity test case.Ted Kremenek2008-09-171-0/+11
| | | | llvm-svn: 56294
* Fix copy-paste error in test case.Ted Kremenek2008-09-161-1/+1
| | | | llvm-svn: 56261
* Minor pass-sensitivity improvement:Ted Kremenek2008-09-161-0/+13
| | | | | | | if we know that 'len != 0' and know that 'i == 0' then we know that 'i < len' must evaluate to true and cannot evaluate to false llvm-svn: 56260
* Tidy up sema processing of attribute "nonull":Ted Kremenek2008-09-011-3/+4
| | | | | | | | - warn about nonnull being applied to functions with no pointer arguments - continue processing argument list in the attribute when we encounter a non-pointer parameter being marked as nonnull - when no argument list is specified, only mark pointers as nonnull. This fixes PR 2732 and radar 6188814. llvm-svn: 55610
* Enhance null-dereference checker test.Ted Kremenek2008-08-161-1/+9
| | | | llvm-svn: 54834
* Add EXTWARN Diagnostic class.Daniel Dunbar2008-08-051-1/+1
| | | | | | | | | | | | - Like EXTENSION but always generates a warning (even without -pedantic). - Updated ptr -> int, int -> ptr, and incompatible cast warnings to be EXTWARN. - Other EXTENSION level diagnostics should be audited for upgrade. - Updated several test cases to fix code which produced unanticipated warnings. llvm-svn: 54335
* Enhanced path-sensitive return-of-stack-address check to print out the name ↵Ted Kremenek2008-07-311-0/+15
| | | | | | of the variable whose address was returned. llvm-svn: 54253
* Added path-sensitive checking for null pointer values passed to function ↵Ted Kremenek2008-07-221-0/+7
| | | | | | | | arguments marked nonnull. This implements <rdar://problem/6069935> llvm-svn: 53891
* Added test case to test null dereference checking with lval::ArrayOffset.Ted Kremenek2008-04-291-0/+10
| | | | llvm-svn: 50454
OpenPOWER on IntegriCloud