summaryrefslogtreecommitdiffstats
path: root/clang/test/Analysis/reinterpret-cast.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [analyzer] Re-enable reasoning about CK_LValueBitCastAnna Zaks2013-05-281-0/+17
| | | | | | | | | It’s important for us to reason about the cast as it is used in std::addressof. The reason we did not handle the cast previously was a crash on a test case (see commit r157478). The crash was in processing array to pointer decay when the region type was not an array. Address the issue, by just returning an unknown in that case. llvm-svn: 182808
* [analyzer] Base regions may be invalid when layered on symbolic regions.Jordan Rose2013-02-251-0/+22
| | | | | | | | | | | | | | | | While RegionStore checks to make sure casts on TypedValueRegions are valid, it does not do the same for SymbolicRegions, which do not have perfect type info anyway. Additionally, MemRegion::getAsOffset does not take a ProgramState, so it can't use dynamic type info to determine a better type for the regions. (This could also be dangerous if the type of a super-region changes!) Account for this by checking that a base object region is valid on top of a symbolic region, and falling back to "symbolic offset" mode if not. Fixes PR15345. llvm-svn: 176034
* [analyzer] Add another reinterpret_cast behavior test.Jordan Rose2013-02-211-0/+18
| | | | | | | The test is similar to <rdar://problem/13239840> but doesn't actually test the case that fails there. It's still a good test, though. llvm-svn: 175715
* [analyzer] Don't assert when mixing reinterpret_cast and derived-to-base casts.Jordan Rose2013-02-151-0/+28
| | | | | | | | | | | | | | | This just adds a very simple check that if a DerivedToBase CastExpr is operating on a value with known C++ object type, and that type is not the base type specified in the AST, then the cast is invalid and we should return UnknownVal. In the future, perhaps we can have a checker that specifies that this is illegal, but we still shouldn't assert even if the user turns that checker off. PR14872 llvm-svn: 175239
* [analyzer] Replace "-analyzer-ipa" with "-analyzer-config ipa".Anna Zaks2013-01-241-1/+1
| | | | | | | | | The idea is to eventually place all analyzer options under "analyzer-config". In addition, this lays the ground for introduction of a high-level analyzer mode option, which will influence the default setting for IPAMode. llvm-svn: 173385
* [analyzer] Only adjust the type of 'this' when we devirtualize a method call.Jordan Rose2012-08-151-0/+20
With reinterpret_cast, we can get completely unrelated types in a region hierarchy together; this was resulting in CXXBaseObjectRegions being layered directly on an (untyped) SymbolicRegion, whose symbol was from a completely different type hierarchy. This was what was causing the internal buildbot to fail. Reverts r161911, which merely masked the problem. llvm-svn: 161960
OpenPOWER on IntegriCloud