summaryrefslogtreecommitdiffstats
path: root/clang/test/Analysis/stack-addr-ps.c
Commit message (Collapse)AuthorAgeFilesLines
* Teach analyzer that blocks with no captures are globals. Fixes ↵Ted Kremenek2012-02-181-1/+17
| | | | | | <rdar://problem/10348049>. llvm-svn: 150896
* Really remove FlatStoreManager and BasicStoreManager, this time from the ↵Ted Kremenek2011-07-281-1/+0
| | | | | | driver. Also remove associated tests. Sorry for the messy commits; this is the result of a botched Git merge. llvm-svn: 136422
* [analyzer] Overhaul how the static analyzer expects CFGs by forcing CFGs to ↵Ted Kremenek2011-07-281-1/+1
| | | | | | | | | | | | be linearized only when used by the static analyzer. This required a rewrite of LiveVariables, and exposed a ton of subtle bugs. The motivation of this large change is to drastically simplify the logic in ExprEngine going forward. Some fallout is that the output of some BugReporterVisitors is not as accurate as before; those will need to be fixed over time. There is also some possible performance regression as RemoveDeadBindings will be called frequently; this can also be improved over time. llvm-svn: 136419
* [analyzer] Remove '-analyzer-check-objc-mem' flag, the nominee for best ↵Argyrios Kyrtzidis2011-02-281-2/+2
| | | | | | misnomer award. llvm-svn: 126676
* [analyzer] Migrate BuiltinFunctionChecker to CheckerV2.Argyrios Kyrtzidis2011-02-281-2/+2
| | | | llvm-svn: 126611
* Update test cases.Ted Kremenek2011-02-251-2/+2
| | | | llvm-svn: 126523
* [analyzer] Use the new registration mechanism on some of the internal ↵Argyrios Kyrtzidis2011-02-151-2/+2
| | | | | | | | | | | | | checks. These are: StackAddrLeakChecker ObjCAtSyncChecker UnixAPIChecker MacOSXAPIChecker The rest have/create implicit dependencies between checkers and need to be handled differently. llvm-svn: 125559
* Tweak stack address checker to report multiple cases where globals may ↵Ted Kremenek2010-06-171-3/+3
| | | | | | | | reference stack memory. Also refactor the diagnostics so that we print out the kind of stack memory returned. llvm-svn: 106210
* Rename -cc1 option '-checker-cfref' to '-analyzer-check-objc-mem'.Ted Kremenek2010-02-051-2/+2
| | | | llvm-svn: 95348
* Fix broken diagnostic when returning the address of a stack-allocated array.Ted Kremenek2010-01-091-0/+7
| | | | llvm-svn: 93071
* Update tests to use %clang_cc1 instead of 'clang-cc' or 'clang -cc1'.Daniel Dunbar2009-12-151-2/+2
| | | | | | | | | - This is designed to make it obvious that %clang_cc1 is a "test variable" which is substituted. It is '%clang_cc1' instead of '%clang -cc1' because it can be useful to redefine what gets run as 'clang -cc1' (for example, to set a default target). llvm-svn: 91446
* Replace clang-cc with clang -cc1.Zhongxing Xu2009-12-141-2/+2
| | | | llvm-svn: 91272
* Improve diagnostics in ReturnStackAddressChecker for returning a ↵Ted Kremenek2009-11-261-2/+15
| | | | | | stack-allocated block. Implements the rest of <rdar://problem/7387385>. llvm-svn: 89940
* Drop unnecessary #include.Daniel Dunbar2009-11-171-2/+0
| | | | llvm-svn: 89154
* Eliminate &&s in tests.Daniel Dunbar2009-11-081-1/+1
| | | | | | - 'for i in $(find . -type f); do sed -e 's#\(RUN:.*[^ ]\) *&& *$#\1#g' $i | FileUpdate $i; done', for the curious. llvm-svn: 86430
* Remove 'StoreManager::OldCastRegion()', TypedViewRegion (which onlyTed Kremenek2009-07-291-1/+0
| | | | | | | OldCastRegion used), and the associated command line option '-analyzer-store=old-basic-cast'. llvm-svn: 77509
* Switch BasicStoreManager to use the new CastRegion implementation by default,Ted Kremenek2009-07-101-1/+1
| | | | | | | | 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/+1
| | | | | | using '-analyzer-store=basic-new-cast'. llvm-svn: 74865
* Enhance RegionStore to lazily symbolicate fields and array elements forTed Kremenek2009-07-021-8/+13
| | | | | | structures passed-by-value as function arguments. llvm-svn: 74729
* Temporarily disable RegionStore for stack-addr-ps.c, as a new test case revealsTed Kremenek2009-07-011-2/+13
| | | | | | | a case where RegionStore doesn't create symbolic values for the fields of structs that are passed-by-value. llvm-svn: 74662
* Introduce a new concept to the static analyzer: SValuator.Ted Kremenek2009-06-261-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* PR3009: Get rid of bogus warning for scalar compound literals.Eli Friedman2009-05-161-1/+1
| | | | | | | | | This patch isn't quite ideal in that it eliminates the warning for constructs like "int a = {1};", where the braces are in fact redundant. However, that would have required a bunch of refactoring, and it's much less likely to cause confusion compared to redundant nested braces. llvm-svn: 71939
* Rename clang to clang-cc.Daniel Dunbar2009-03-241-3/+3
| | | | | | Tests and drivers updated, still need to shuffle dirs. llvm-svn: 67602
* Fix test: config.h is not guaranteed to exist at the location in Eli Friedman2009-02-181-5/+1
| | | | | | | question. Use __builtin_alloca instead, which is guaranteed to mean the right thing without any includes. llvm-svn: 64868
* Eliminate dependency on where test is run from.Daniel Dunbar2009-02-171-4/+4
| | | | llvm-svn: 64837
* Don't include alloca.h if it doesn't exist.Ben Laurie2009-02-171-4/+7
| | | | llvm-svn: 64771
* Static Analyzer driver/options (partial) cleanup:Ted Kremenek2009-02-171-2/+2
| | | | | | | | | | | | | | - 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
* This test case now passes with RegionStore.Ted Kremenek2009-01-221-1/+3
| | | | llvm-svn: 62802
* Add -analyze action to run static analyzer, instead of inferring fromDaniel Dunbar2009-01-201-1/+1
| | | | | | individual checker options. llvm-svn: 62634
* MemRegion:Ted Kremenek2008-12-131-1/+0
| | | | | | | | | | | | | | | | | | | | | | - Overhauled the notion of "types" for TypedRegions. We now distinguish between the "lvalue" of a region (via getLValueRegion()) and the "rvalue" of a region (va getRValueRegion()). Since a region represents a chunk of memory it has both, but we were conflating these concepts in some cases, leading to some insidious bugs. - Removed AnonPointeeType, partially because it is unused and because it doesn't have a clear notion of lvalue vs rvalue type. We can add it back once there is a need for it and we can resolve its role with these concepts. StoreManager: - Overhauled StoreManager::CastRegion. It expects an *lvalue* type for a region. This is actually what motivated the overhaul to the MemRegion type mechanism. It also no longer returns an SVal; we can just return a MemRegion*. - BasicStoreManager::CastRegion now overlays an "AnonTypedRegion" for pointer-pointer casts. This matches with the MemRegion changes. - Similar changes to RegionStore, except I've added a bunch of FIXMEs where it wasn't 100% clear where we should use TypedRegion::getRValueRegion() or TypedRegion::getLValueRegion(). AuditCFNumberCreate check: - Now blasts through AnonTypedRegions that may layer the original memory region, thus checking if the actually memory block is of the appropriate type. This change was needed to work with the changes to StoreManager::CastRegion. GRExprEngine::VisitCast: - Conform to the new interface of StoreManager::CastRegion. Tests: - None of the analysis tests fail now for using the "basic store". - Disabled the tests 'array-struct.c' and 'rdar-6442306-1.m' pending further testing and bug fixing. llvm-svn: 60995
* Temporarily XFAIL these tests.Ted Kremenek2008-12-131-0/+1
| | | | llvm-svn: 60991
* include alloca.h instead of malloc.h. If this doesn't work for everyone we ↵Anders Carlsson2008-11-071-1/+1
| | | | | | can just declare alloca directly in the file. llvm-svn: 58853
* Bring in 'alloca' for the Analysis/stack-addr-ps.c test case.Argyrios Kyrtzidis2008-11-071-0/+1
| | | | llvm-svn: 58849
* Add 'alloca' test case for return-of-stack-address checker.Ted Kremenek2008-11-021-0/+7
| | | | llvm-svn: 58554
* Added missing 'expected-warning'Ted Kremenek2008-10-311-1/+1
| | | | llvm-svn: 58481
* Enhance compound literal test case.Ted Kremenek2008-10-311-2/+8
| | | | llvm-svn: 58480
* Add missing "expected warning".Ted Kremenek2008-10-301-2/+3
| | | | | | Add compound literal with empty initializer (just to test the analyzer handles it). llvm-svn: 58470
* Improve compound literal test case.Ted Kremenek2008-10-301-2/+6
| | | | llvm-svn: 58447
* Add 'expected-warning' for braces around scalar initializerTed Kremenek2008-10-271-1/+1
| | | | llvm-svn: 58280
* Added compound literal test case.Ted Kremenek2008-10-271-0/+3
| | | | llvm-svn: 58279
* Enhanced path-sensitive return-of-stack-address check to print out the name ↵Ted Kremenek2008-07-311-3/+3
| | | | | | of the variable whose address was returned. llvm-svn: 54253
* Refactored all logic to run the GRSimpleVals and CFRef checker into a commonTed Kremenek2008-04-101-1/+1
| | | | | | | | code path in the clang driver. Renamed options --grsimple to -checker-simple and -check-cfref to -checker-cfref. llvm-svn: 49500
* Added path-sensitive check for return statements that return the addressTed Kremenek2008-03-311-0/+21
of a stack variable. This is the path-sensitive version of a check that is already done during semantic analysis. llvm-svn: 48980
OpenPOWER on IntegriCloud