diff options
-rw-r--r-- | include/clang/Analysis/PathSensitive/MemRegion.h | 10 | ||||
-rw-r--r-- | lib/Analysis/MemRegion.cpp | 5 |
2 files changed, 7 insertions, 8 deletions
diff --git a/include/clang/Analysis/PathSensitive/MemRegion.h b/include/clang/Analysis/PathSensitive/MemRegion.h index 743a3b9098..2ddaa20d32 100644 --- a/include/clang/Analysis/PathSensitive/MemRegion.h +++ b/include/clang/Analysis/PathSensitive/MemRegion.h @@ -154,18 +154,16 @@ public: } QualType getDesugaredRValueType(ASTContext& C) const { - return getRValueType(C)->getDesugaredType(); + QualType T = getRValueType(C); + return T.getTypePtr() ? T->getDesugaredType() : T; } QualType getDesugaredLValueType(ASTContext& C) const { return getLValueType(C)->getDesugaredType(); } - + bool isBoundable(ASTContext &C) const { - // FIXME: This needs to be adjusted for structures and arrays. - // All this will reject right now is ObjCQualifiedIdType and - // BlockPointerType. - return getLValueType(C)->isPointerType(); + return !getRValueType(C).isNull(); } static bool classof(const MemRegion* R) { diff --git a/lib/Analysis/MemRegion.cpp b/lib/Analysis/MemRegion.cpp index 8dd31b54b0..c304b659b6 100644 --- a/lib/Analysis/MemRegion.cpp +++ b/lib/Analysis/MemRegion.cpp @@ -123,8 +123,9 @@ QualType SymbolicRegion::getRValueType(ASTContext& C) const { if (const BlockPointerType* PTy = T->getAsBlockPointerType()) return PTy->getPointeeType(); - assert(!T->getAsObjCQualifiedIdType() && - "There is no rvalue type for id<...>"); + // There is no rvalue type of id<...>. + if (T->getAsObjCQualifiedIdType()) + return QualType(); assert(Loc::IsLocType(T) && "Non-location type."); return QualType(); |