diff options
author | Alexey Bataev <a.bataev@hotmail.com> | 2019-03-14 20:36:00 +0000 |
---|---|---|
committer | Alexey Bataev <a.bataev@hotmail.com> | 2019-03-14 20:36:00 +0000 |
commit | 0d8fcdf11a237fc463598050c23a57d5db8d8f65 (patch) | |
tree | 01d0f01d93f7ea80f58464d4ff959722332b780b /clang/lib/Sema/SemaOpenMP.cpp | |
parent | c4420b00f1028d674935d8515f9af29619f2651e (diff) | |
download | bcm5719-llvm-0d8fcdf11a237fc463598050c23a57d5db8d8f65.tar.gz bcm5719-llvm-0d8fcdf11a237fc463598050c23a57d5db8d8f65.zip |
[OPENMP]Fix crash for the ordered(n) clause.
If the doacross lop construct is used and the loop counter is declare
outside of the loop, the compiler might crash trying to get the address
of the loop counter. Patch fixes this problem.
llvm-svn: 356198
Diffstat (limited to 'clang/lib/Sema/SemaOpenMP.cpp')
-rw-r--r-- | clang/lib/Sema/SemaOpenMP.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/clang/lib/Sema/SemaOpenMP.cpp b/clang/lib/Sema/SemaOpenMP.cpp index fbbef37a2e6..69fcacf22a2 100644 --- a/clang/lib/Sema/SemaOpenMP.cpp +++ b/clang/lib/Sema/SemaOpenMP.cpp @@ -4758,8 +4758,7 @@ DeclRefExpr *OpenMPIterationSpaceChecker::buildCounterVar( Captures.insert(std::make_pair(LCRef, Ref)); return Ref; } - return buildDeclRefExpr(SemaRef, VD, VD->getType().getNonReferenceType(), - DefaultLoc); + return cast<DeclRefExpr>(LCRef); } Expr *OpenMPIterationSpaceChecker::buildPrivateCounterVar() const { |