diff options
author | Jordan Rose <jordan_rose@apple.com> | 2012-08-13 22:11:34 +0000 |
---|---|---|
committer | Jordan Rose <jordan_rose@apple.com> | 2012-08-13 22:11:34 +0000 |
commit | b11a3ada9a22e146c6edd33bcc6301e221fedd7a (patch) | |
tree | 24ec1f87444dfaaf1eb5fb09daa5cb040b9355d3 /include/clang/StaticAnalyzer/Core/PathSensitive | |
parent | 58d33ad9c83f1195a7db544e4b41daa019aaa767 (diff) |
[analyzer] Don't strip CXXBaseObjectRegions when checking dynamic_casts.
...and /do/ strip CXXBaseObjectRegions when casting to a virtual base class.
This allows us to enforce the invariant that a CXXBaseObjectRegion can always
provide an offset for its base region if its base region has a known class
type, by only allowing virtual bases and direct non-virtual bases to form
CXXBaseObjectRegions.
This does mean some slight problems for our modeling of dynamic_cast, which
needs to be resolved by finding a path from the current region to the class
we're trying to cast to.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161797 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/StaticAnalyzer/Core/PathSensitive')
-rw-r--r-- | include/clang/StaticAnalyzer/Core/PathSensitive/MemRegion.h | 2 | ||||
-rw-r--r-- | include/clang/StaticAnalyzer/Core/PathSensitive/SVals.h | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/include/clang/StaticAnalyzer/Core/PathSensitive/MemRegion.h b/include/clang/StaticAnalyzer/Core/PathSensitive/MemRegion.h index 1281cfbda9..01218effff 100644 --- a/include/clang/StaticAnalyzer/Core/PathSensitive/MemRegion.h +++ b/include/clang/StaticAnalyzer/Core/PathSensitive/MemRegion.h @@ -138,7 +138,7 @@ public: const MemRegion *getBaseRegion() const; - const MemRegion *StripCasts() const; + const MemRegion *StripCasts(bool StripBaseCasts = true) const; bool hasGlobalsOrParametersStorage() const; diff --git a/include/clang/StaticAnalyzer/Core/PathSensitive/SVals.h b/include/clang/StaticAnalyzer/Core/PathSensitive/SVals.h index e462657728..e0b5f64b90 100644 --- a/include/clang/StaticAnalyzer/Core/PathSensitive/SVals.h +++ b/include/clang/StaticAnalyzer/Core/PathSensitive/SVals.h @@ -433,7 +433,7 @@ public: } /// \brief Get the underlining region and strip casts. - const MemRegion* stripCasts() const; + const MemRegion* stripCasts(bool StripBaseCasts = true) const; template <typename REGION> const REGION* getRegionAs() const { |