From: Zhongxing Xu Date: Fri, 23 Jan 2009 10:19:29 +0000 (+0000) Subject: When getting the element region type, we should get the rvalue type of the super X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c496f14291b6577cf9bb1737efae01cce71182e2;p=clang When getting the element region type, we should get the rvalue type of the super region. Otherwise we would get an extra level of pointer type. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62844 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Analysis/MemRegion.cpp b/lib/Analysis/MemRegion.cpp index 72b1e0b4f7..2724ed0ada 100644 --- a/lib/Analysis/MemRegion.cpp +++ b/lib/Analysis/MemRegion.cpp @@ -108,8 +108,8 @@ void ElementRegion::Profile(llvm::FoldingSetNodeID& ID) const { } QualType ElementRegion::getRValueType(ASTContext& C) const { - QualType T = getArrayRegion()->getLValueType(C); - // FIXME: Should ArrayType be considered an LValue or RValue type? + QualType T = getArrayRegion()->getRValueType(C); + if (isa(T.getTypePtr())) { ArrayType* AT = cast(T.getTypePtr()); return AT->getElementType();