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 72b1e0b..2724ed0 100644
--- a/lib/Analysis/MemRegion.cpp
+++ b/lib/Analysis/MemRegion.cpp
@@ -108,8 +108,8 @@
}
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<ArrayType>(T.getTypePtr())) {
ArrayType* AT = cast<ArrayType>(T.getTypePtr());
return AT->getElementType();