summaryrefslogtreecommitdiffstats
path: root/lib/StaticAnalyzer/Core/MemRegion.cpp
diff options
context:
space:
mode:
authorsvnmir <svnmir@FreeBSD.org>2015-08-07 23:02:56 +0000
committersvnmir <svnmir@FreeBSD.org>2015-08-07 23:02:56 +0000
commit6416b56f5a3923c6c264b46365e16718ccabf081 (patch)
treeca13cf9e2e8c2499f61f1246e455efd2804abd36 /lib/StaticAnalyzer/Core/MemRegion.cpp
parente7bcad327814a78ecb8d5f5545d2e3df84c67a5c (diff)
downloadFreeBSD-src-6416b56f5a3923c6c264b46365e16718ccabf081.zip
FreeBSD-src-6416b56f5a3923c6c264b46365e16718ccabf081.tar.gz
Vendor import of clang trunk r242221:
https://llvm.org/svn/llvm-project/cfe/trunk@242221
Diffstat (limited to 'lib/StaticAnalyzer/Core/MemRegion.cpp')
-rw-r--r--lib/StaticAnalyzer/Core/MemRegion.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/StaticAnalyzer/Core/MemRegion.cpp b/lib/StaticAnalyzer/Core/MemRegion.cpp
index 1fa6754..5ac8458 100644
--- a/lib/StaticAnalyzer/Core/MemRegion.cpp
+++ b/lib/StaticAnalyzer/Core/MemRegion.cpp
@@ -824,9 +824,12 @@ const VarRegion* MemRegionManager::getVarRegion(const VarDecl *D,
QualType T;
if (const TypeSourceInfo *TSI = BD->getSignatureAsWritten())
T = TSI->getType();
- else
- T = getContext().getFunctionNoProtoType(getContext().VoidTy);
-
+ if (T.isNull())
+ T = getContext().VoidTy;
+ if (!T->getAs<FunctionType>())
+ T = getContext().getFunctionNoProtoType(T);
+ T = getContext().getBlockPointerType(T);
+
const BlockTextRegion *BTR =
getBlockTextRegion(BD, C.getCanonicalType(T),
STC->getAnalysisDeclContext());
OpenPOWER on IntegriCloud