diff options
author | Artem Dergachev <artem.dergachev@gmail.com> | 2019-04-03 18:21:16 +0000 |
---|---|---|
committer | Artem Dergachev <artem.dergachev@gmail.com> | 2019-04-03 18:21:16 +0000 |
commit | 3d90e7e8db2c522c87f0fbfcdcb9aeed62680922 (patch) | |
tree | 32fcd49ab9ea9d85079d3a5eea2a42046fb843da /clang/lib/StaticAnalyzer/Core/CallEvent.cpp | |
parent | 1362d7ef885d1e8136e19d85c0eeba3477b53020 (diff) | |
download | bcm5719-llvm-3d90e7e8db2c522c87f0fbfcdcb9aeed62680922.tar.gz bcm5719-llvm-3d90e7e8db2c522c87f0fbfcdcb9aeed62680922.zip |
Revert "[analyzer] Toning down invalidation a bit".
This reverts commit r352473.
The overall idea is great, but it seems to cause unintented consequences
when not only Region Store invalidation but also pointer escape mechanism
was accidentally affected.
Based on discussions in https://reviews.llvm.org/D58121#1452483
and https://reviews.llvm.org/D57230#1434161
Differential Revision: https://reviews.llvm.org/D57230
llvm-svn: 357620
Diffstat (limited to 'clang/lib/StaticAnalyzer/Core/CallEvent.cpp')
-rw-r--r-- | clang/lib/StaticAnalyzer/Core/CallEvent.cpp | 22 |
1 files changed, 5 insertions, 17 deletions
diff --git a/clang/lib/StaticAnalyzer/Core/CallEvent.cpp b/clang/lib/StaticAnalyzer/Core/CallEvent.cpp index 8dc6646e0eb..11dda7c3acb 100644 --- a/clang/lib/StaticAnalyzer/Core/CallEvent.cpp +++ b/clang/lib/StaticAnalyzer/Core/CallEvent.cpp @@ -303,23 +303,11 @@ ProgramStateRef CallEvent::invalidateRegions(unsigned BlockCount, for (unsigned Idx = 0, Count = getNumArgs(); Idx != Count; ++Idx) { // Mark this region for invalidation. We batch invalidate regions // below for efficiency. - if (const MemRegion *MR = getArgSVal(Idx).getAsRegion()) { - bool UseBaseRegion = true; - if (const auto *FR = MR->getAs<FieldRegion>()) { - if (const auto *TVR = FR->getSuperRegion()->getAs<TypedValueRegion>()) { - if (!TVR->getValueType()->isUnionType()) { - ETraits.setTrait(MR, RegionAndSymbolInvalidationTraits:: - TK_DoNotInvalidateSuperRegion); - UseBaseRegion = false; - } - } - } - // todo: factor this out + handle the lower level const pointers. - if (PreserveArgs.count(Idx)) - ETraits.setTrait( - UseBaseRegion ? MR->getBaseRegion() : MR, - RegionAndSymbolInvalidationTraits::TK_PreserveContents); - } + if (PreserveArgs.count(Idx)) + if (const MemRegion *MR = getArgSVal(Idx).getAsRegion()) + ETraits.setTrait(MR->getBaseRegion(), + RegionAndSymbolInvalidationTraits::TK_PreserveContents); + // TODO: Factor this out + handle the lower level const pointers. ValuesToInvalidate.push_back(getArgSVal(Idx)); |