summaryrefslogtreecommitdiffstats
path: root/clang/lib/StaticAnalyzer/Core/CallEvent.cpp
diff options
context:
space:
mode:
authorArtem Dergachev <artem.dergachev@gmail.com>2016-04-25 14:44:25 +0000
committerArtem Dergachev <artem.dergachev@gmail.com>2016-04-25 14:44:25 +0000
commit70247e69b1f1fde7f11b6cd81bc50162f9b79ab2 (patch)
treec562c6bc4b43624c42b4ecbb8c562048ec2ffa52 /clang/lib/StaticAnalyzer/Core/CallEvent.cpp
parentdd215236530c9f643220f1c6e928dd39254a7b3d (diff)
downloadbcm5719-llvm-70247e69b1f1fde7f11b6cd81bc50162f9b79ab2.tar.gz
bcm5719-llvm-70247e69b1f1fde7f11b6cd81bc50162f9b79ab2.zip
[analyzer] Let TK_PreserveContents span across the whole base region.
If an address of a field is passed through a const pointer, the whole structure's base region should receive the TK_PreserveContents trait and avoid invalidation. Additionally, include a few FIXME tests shown up during testing. Differential Revision: http://reviews.llvm.org/D19057 llvm-svn: 267413
Diffstat (limited to 'clang/lib/StaticAnalyzer/Core/CallEvent.cpp')
-rw-r--r--clang/lib/StaticAnalyzer/Core/CallEvent.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/StaticAnalyzer/Core/CallEvent.cpp b/clang/lib/StaticAnalyzer/Core/CallEvent.cpp
index 626775846bb..52613186677 100644
--- a/clang/lib/StaticAnalyzer/Core/CallEvent.cpp
+++ b/clang/lib/StaticAnalyzer/Core/CallEvent.cpp
@@ -177,7 +177,7 @@ ProgramStateRef CallEvent::invalidateRegions(unsigned BlockCount,
// below for efficiency.
if (PreserveArgs.count(Idx))
if (const MemRegion *MR = getArgSVal(Idx).getAsRegion())
- ETraits.setTrait(MR->StripCasts(),
+ ETraits.setTrait(MR->getBaseRegion(),
RegionAndSymbolInvalidationTraits::TK_PreserveContents);
// TODO: Factor this out + handle the lower level const pointers.
OpenPOWER on IntegriCloud