summaryrefslogtreecommitdiffstats
path: root/clang/lib/StaticAnalyzer/Core/RegionStore.cpp
diff options
context:
space:
mode:
authorDevin Coughlin <dcoughlin@apple.com>2015-11-05 18:56:42 +0000
committerDevin Coughlin <dcoughlin@apple.com>2015-11-05 18:56:42 +0000
commite949add6871f1d3e6f533eda527e61f841f2dd3c (patch)
treeb1de315af33615803d77e67f8ae39a8c3e41fda2 /clang/lib/StaticAnalyzer/Core/RegionStore.cpp
parent6192d1c050bf9cf6ea9f20e5ec8d3fd380088b9b (diff)
downloadbcm5719-llvm-e949add6871f1d3e6f533eda527e61f841f2dd3c.tar.gz
bcm5719-llvm-e949add6871f1d3e6f533eda527e61f841f2dd3c.zip
[analyzer] Update RegionStoreManager::getBinding to handle BlockDataRegions
Update RegionStoreManager::getBinding() to return UnknownVal when trying to get the binding for a BlockDataRegion. Previously, getBinding() would try to cast the BlockDataRegion to a TypedValueRegion and crash. This happened when a block was passed as a parameter to an inlined function for which StackHintGeneratorForSymbol::getMessage() tried to generate a stack hint message. rdar://problem/21291971 llvm-svn: 252185
Diffstat (limited to 'clang/lib/StaticAnalyzer/Core/RegionStore.cpp')
-rw-r--r--clang/lib/StaticAnalyzer/Core/RegionStore.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/lib/StaticAnalyzer/Core/RegionStore.cpp b/clang/lib/StaticAnalyzer/Core/RegionStore.cpp
index 0d973130401..1fe83ef7639 100644
--- a/clang/lib/StaticAnalyzer/Core/RegionStore.cpp
+++ b/clang/lib/StaticAnalyzer/Core/RegionStore.cpp
@@ -1365,6 +1365,10 @@ SVal RegionStoreManager::getBinding(RegionBindingsConstRef B, Loc L, QualType T)
const MemRegion *MR = L.castAs<loc::MemRegionVal>().getRegion();
+ if (isa<BlockDataRegion>(MR)) {
+ return UnknownVal();
+ }
+
if (isa<AllocaRegion>(MR) ||
isa<SymbolicRegion>(MR) ||
isa<CodeTextRegion>(MR)) {
OpenPOWER on IntegriCloud