diff options
author | George Karpenkov <ekarpenkov@apple.com> | 2018-01-17 20:27:26 +0000 |
---|---|---|
committer | George Karpenkov <ekarpenkov@apple.com> | 2018-01-17 20:27:26 +0000 |
commit | cf9ff89663d7fac3759eb2b0bb9030a7bf97e47f (patch) | |
tree | c5817362aac9b1edadb89c599b14d7e36ace5da9 /clang/lib/StaticAnalyzer/Core/RegionStore.cpp | |
parent | 1963d71cb8b8b4e66d71d83cde3d23f059386bcc (diff) | |
download | bcm5719-llvm-cf9ff89663d7fac3759eb2b0bb9030a7bf97e47f.tar.gz bcm5719-llvm-cf9ff89663d7fac3759eb2b0bb9030a7bf97e47f.zip |
[analyzer] Make isSubRegionOf reflexive
All usages of isSubRegionOf separately check for reflexive case, and in
any case, set theory tells us that each set is a subset of itself.
Differential Revision: https://reviews.llvm.org/D42140
llvm-svn: 322752
Diffstat (limited to 'clang/lib/StaticAnalyzer/Core/RegionStore.cpp')
-rw-r--r-- | clang/lib/StaticAnalyzer/Core/RegionStore.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/lib/StaticAnalyzer/Core/RegionStore.cpp b/clang/lib/StaticAnalyzer/Core/RegionStore.cpp index e2e69bb28ec..604adde9a7f 100644 --- a/clang/lib/StaticAnalyzer/Core/RegionStore.cpp +++ b/clang/lib/StaticAnalyzer/Core/RegionStore.cpp @@ -871,7 +871,7 @@ collectSubRegionBindings(SmallVectorImpl<BindingPair> &Bindings, } else if (NextKey.hasSymbolicOffset()) { const MemRegion *Base = NextKey.getConcreteOffsetRegion(); - if (Top->isSubRegionOf(Base)) { + if (Top->isSubRegionOf(Base) && Top != Base) { // Case 3: The next key is symbolic and we just changed something within // its concrete region. We don't know if the binding is still valid, so // we'll be conservative and include it. @@ -881,7 +881,7 @@ collectSubRegionBindings(SmallVectorImpl<BindingPair> &Bindings, } else if (const SubRegion *BaseSR = dyn_cast<SubRegion>(Base)) { // Case 4: The next key is symbolic, but we changed a known // super-region. In this case the binding is certainly included. - if (Top == Base || BaseSR->isSubRegionOf(Top)) + if (BaseSR->isSubRegionOf(Top)) if (isCompatibleWithFields(NextKey, FieldsInSymbolicSubregions)) Bindings.push_back(*I); } |