summaryrefslogtreecommitdiffstats
path: root/clang/lib/StaticAnalyzer/Core
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2011-02-19 08:03:18 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2011-02-19 08:03:18 +0000
commiteb8357c1d812e002fa539f75a859938cb32d88e8 (patch)
tree59613fbc187f13026948c6dd81d03012388b6783 /clang/lib/StaticAnalyzer/Core
parentecdd68d76014885ae47362024cedc24b1e26ab4b (diff)
downloadbcm5719-llvm-eb8357c1d812e002fa539f75a859938cb32d88e8.tar.gz
bcm5719-llvm-eb8357c1d812e002fa539f75a859938cb32d88e8.zip
[analyzer] Fix crash when analyzing C++ code.
llvm-svn: 126025
Diffstat (limited to 'clang/lib/StaticAnalyzer/Core')
-rw-r--r--clang/lib/StaticAnalyzer/Core/SValBuilder.cpp2
-rw-r--r--clang/lib/StaticAnalyzer/Core/Store.cpp2
2 files changed, 2 insertions, 2 deletions
diff --git a/clang/lib/StaticAnalyzer/Core/SValBuilder.cpp b/clang/lib/StaticAnalyzer/Core/SValBuilder.cpp
index 796613383bd..b0fd497e571 100644
--- a/clang/lib/StaticAnalyzer/Core/SValBuilder.cpp
+++ b/clang/lib/StaticAnalyzer/Core/SValBuilder.cpp
@@ -292,7 +292,7 @@ SVal SValBuilder::evalCast(SVal val, QualType castTy, QualType originalTy) {
// }
assert(Loc::isLocType(originalTy) || originalTy->isFunctionType() ||
- originalTy->isBlockPointerType());
+ originalTy->isBlockPointerType() || castTy->isReferenceType());
StoreManager &storeMgr = StateMgr.getStoreManager();
diff --git a/clang/lib/StaticAnalyzer/Core/Store.cpp b/clang/lib/StaticAnalyzer/Core/Store.cpp
index 379327fbb59..722517097c7 100644
--- a/clang/lib/StaticAnalyzer/Core/Store.cpp
+++ b/clang/lib/StaticAnalyzer/Core/Store.cpp
@@ -78,7 +78,7 @@ const MemRegion *StoreManager::castRegion(const MemRegion *R, QualType CastToTy)
// Now assume we are casting from pointer to pointer. Other cases should
// already be handled.
- QualType PointeeTy = CastToTy->getAs<PointerType>()->getPointeeType();
+ QualType PointeeTy = CastToTy->getPointeeType();
QualType CanonPointeeTy = Ctx.getCanonicalType(PointeeTy);
// Handle casts to void*. We just pass the region through.
OpenPOWER on IntegriCloud