summaryrefslogtreecommitdiffstats
path: root/clang/lib/StaticAnalyzer/Core/RegionStore.cpp
diff options
context:
space:
mode:
authorGeorge Karpenkov <ekarpenkov@apple.com>2018-03-02 00:55:59 +0000
committerGeorge Karpenkov <ekarpenkov@apple.com>2018-03-02 00:55:59 +0000
commit0ffcaf7437972dd9f8ba9be50ac14570d4305681 (patch)
tree93b339bb837780552e2d370b394058fcf5c16cec /clang/lib/StaticAnalyzer/Core/RegionStore.cpp
parent534673a560f58a72c36e879cfa921c16fab51285 (diff)
downloadbcm5719-llvm-0ffcaf7437972dd9f8ba9be50ac14570d4305681.tar.gz
bcm5719-llvm-0ffcaf7437972dd9f8ba9be50ac14570d4305681.zip
[analyzer] Prevent crashing in NonNullParamChecker
https://bugs.llvm.org/show_bug.cgi?id=36381 rdar://37543426 Turns out, the type passed for the lambda capture was incorrect. One more argument to abandon the getSVal overload which does not require the type information. Differential Revision: https://reviews.llvm.org/D43925 llvm-svn: 326520
Diffstat (limited to 'clang/lib/StaticAnalyzer/Core/RegionStore.cpp')
-rw-r--r--clang/lib/StaticAnalyzer/Core/RegionStore.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/clang/lib/StaticAnalyzer/Core/RegionStore.cpp b/clang/lib/StaticAnalyzer/Core/RegionStore.cpp
index 01812991892..b752da4437b 100644
--- a/clang/lib/StaticAnalyzer/Core/RegionStore.cpp
+++ b/clang/lib/StaticAnalyzer/Core/RegionStore.cpp
@@ -1405,6 +1405,8 @@ SVal RegionStoreManager::getBinding(RegionBindingsConstRef B, Loc L, QualType T)
assert(!T.isNull() && "Unable to auto-detect binding type!");
assert(!T->isVoidType() && "Attempting to dereference a void pointer!");
MR = GetElementZeroRegion(cast<SubRegion>(MR), T);
+ } else {
+ T = cast<TypedValueRegion>(MR)->getValueType();
}
// FIXME: Perhaps this method should just take a 'const MemRegion*' argument
OpenPOWER on IntegriCloud