]> granicus.if.org Git - clang/commitdiff
[analyzer] Fixed a rare crash when analyzing lambda functions.
authorGabor Horvath <xazax.hun@gmail.com>
Mon, 26 Oct 2015 13:32:26 +0000 (13:32 +0000)
committerGabor Horvath <xazax.hun@gmail.com>
Mon, 26 Oct 2015 13:32:26 +0000 (13:32 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@251289 91177308-0d34-0410-b5e6-96231b3b80d8

lib/StaticAnalyzer/Core/MemRegion.cpp

index d41fed0619e730d7f7399c2313f5cfd9ec7b7a76..86e33969d21b62fb6ef0ed0566e62709ea275daf 100644 (file)
@@ -1022,7 +1022,7 @@ MemRegionManager::getCXXThisRegion(QualType thisPointerTy,
   // 'this' refers to a this to the enclosing scope, there is no right region to
   // return.
   while (!LC->inTopFrame() &&
-         PT != D->getThisType(getContext())->getAs<PointerType>()) {
+         (!D || PT != D->getThisType(getContext())->getAs<PointerType>())) {
     LC = LC->getParent();
     D = dyn_cast<CXXMethodDecl>(LC->getDecl());
   }