summaryrefslogtreecommitdiffstats
path: root/clang/lib/StaticAnalyzer/Core/CallEvent.cpp
diff options
context:
space:
mode:
authorDevin Coughlin <dcoughlin@apple.com>2015-11-09 19:50:29 +0000
committerDevin Coughlin <dcoughlin@apple.com>2015-11-09 19:50:29 +0000
commit9c76869bc33c25d07d5b4ed3eacf310e3f3537cb (patch)
treef9e1d4a8dc1e48810c8c5d88ca139925c02a9b24 /clang/lib/StaticAnalyzer/Core/CallEvent.cpp
parent390191dacc4e3573dcd778b6afbf42db53bc2c15 (diff)
downloadbcm5719-llvm-9c76869bc33c25d07d5b4ed3eacf310e3f3537cb.tar.gz
bcm5719-llvm-9c76869bc33c25d07d5b4ed3eacf310e3f3537cb.zip
[analyzer] Fix assertion failure invalidating on const member function calls (PR25392).
We now return early when the 'this' value cannot be converted to a MemRegion. llvm-svn: 252506
Diffstat (limited to 'clang/lib/StaticAnalyzer/Core/CallEvent.cpp')
-rw-r--r--clang/lib/StaticAnalyzer/Core/CallEvent.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/clang/lib/StaticAnalyzer/Core/CallEvent.cpp b/clang/lib/StaticAnalyzer/Core/CallEvent.cpp
index 32c168819bf..a07427a57e0 100644
--- a/clang/lib/StaticAnalyzer/Core/CallEvent.cpp
+++ b/clang/lib/StaticAnalyzer/Core/CallEvent.cpp
@@ -438,7 +438,9 @@ void CXXInstanceCall::getExtraInvalidatedValues(ValueList &Values,
return;
// Preserve CXXThis.
const MemRegion *ThisRegion = ThisVal.getAsRegion();
- assert(ThisRegion && "ThisValue was not a memory region");
+ if (!ThisRegion)
+ return;
+
ETraits->setTrait(ThisRegion->getBaseRegion(),
RegionAndSymbolInvalidationTraits::TK_PreserveContents);
}
OpenPOWER on IntegriCloud