summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaOpenMP.cpp
diff options
context:
space:
mode:
authorAlexey Bataev <a.bataev@hotmail.com>2019-04-29 15:51:36 +0000
committerAlexey Bataev <a.bataev@hotmail.com>2019-04-29 15:51:36 +0000
commite66bf6357fdf7978926bae1ae3e92a3e56f894dc (patch)
tree53983e771ccc840b9b4ace42e2e843f758c13b6b /clang/lib/Sema/SemaOpenMP.cpp
parent8a02f8d92801e040efecd595be9d2f2dcfaca164 (diff)
downloadbcm5719-llvm-e66bf6357fdf7978926bae1ae3e92a3e56f894dc.tar.gz
bcm5719-llvm-e66bf6357fdf7978926bae1ae3e92a3e56f894dc.zip
[OPENMP]Fix PR41617: crash on template instantiation.
Fixed the crash on the template instantiation when trying to check the data locality in the current instantiation scope. llvm-svn: 359459
Diffstat (limited to 'clang/lib/Sema/SemaOpenMP.cpp')
-rw-r--r--clang/lib/Sema/SemaOpenMP.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaOpenMP.cpp b/clang/lib/Sema/SemaOpenMP.cpp
index 2011c0b9277..0aebd8e03a6 100644
--- a/clang/lib/Sema/SemaOpenMP.cpp
+++ b/clang/lib/Sema/SemaOpenMP.cpp
@@ -1145,7 +1145,7 @@ bool DSAStackTy::isOpenMPLocal(VarDecl *D, iterator Iter) const {
return false;
TopScope = I->CurScope ? I->CurScope->getParent() : nullptr;
Scope *CurScope = getCurScope();
- while (CurScope != TopScope && !CurScope->isDeclScope(D))
+ while (CurScope && CurScope != TopScope && !CurScope->isDeclScope(D))
CurScope = CurScope->getParent();
return CurScope != TopScope;
}
OpenPOWER on IntegriCloud