summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGExpr.cpp
diff options
context:
space:
mode:
authorAlexey Bataev <a.bataev@hotmail.com>2017-10-12 15:18:41 +0000
committerAlexey Bataev <a.bataev@hotmail.com>2017-10-12 15:18:41 +0000
commit7b0f1f09a9f3576e6175c85233eebee1a635c582 (patch)
treeea7f33feccdb2a1d80efe7aded06c91fe801b21d /clang/lib/CodeGen/CGExpr.cpp
parentd7d752ad339064493fde61f9a98b858ed04c9daf (diff)
downloadbcm5719-llvm-7b0f1f09a9f3576e6175c85233eebee1a635c582.tar.gz
bcm5719-llvm-7b0f1f09a9f3576e6175c85233eebee1a635c582.zip
[OPENMP] Fix PR34926: Fix handling of the array sections passed as
function params. Codegen could crash if the array section base expression is the function parameter. llvm-svn: 315586
Diffstat (limited to 'clang/lib/CodeGen/CGExpr.cpp')
-rw-r--r--clang/lib/CodeGen/CGExpr.cpp7
1 files changed, 1 insertions, 6 deletions
diff --git a/clang/lib/CodeGen/CGExpr.cpp b/clang/lib/CodeGen/CGExpr.cpp
index 798a2ef0c5d..0f2e328effc 100644
--- a/clang/lib/CodeGen/CGExpr.cpp
+++ b/clang/lib/CodeGen/CGExpr.cpp
@@ -3349,12 +3349,7 @@ static Address emitOMPArraySectionBase(CodeGenFunction &CGF, const Expr *Base,
LValue CodeGenFunction::EmitOMPArraySectionExpr(const OMPArraySectionExpr *E,
bool IsLowerBound) {
- QualType BaseTy;
- if (auto *ASE =
- dyn_cast<OMPArraySectionExpr>(E->getBase()->IgnoreParenImpCasts()))
- BaseTy = OMPArraySectionExpr::getBaseOriginalType(ASE);
- else
- BaseTy = E->getBase()->getType();
+ QualType BaseTy = OMPArraySectionExpr::getBaseOriginalType(E->getBase());
QualType ResultExprTy;
if (auto *AT = getContext().getAsArrayType(BaseTy))
ResultExprTy = AT->getElementType();
OpenPOWER on IntegriCloud