forked from OSchip/llvm-project
[OPENMP]Fix PR42632: crash on the analysis of the OpenMP constructs.
Fixed processing of the CapturedStmt children to fix the crash of the OpenMP constructs during analysis. llvm-svn: 366357
This commit is contained in:
parent
f90d3dff6e
commit
48f5a43bcc
|
@ -83,6 +83,18 @@ static void BuildParentMap(MapTy& M, Stmt* S,
|
|||
}
|
||||
break;
|
||||
}
|
||||
case Stmt::CapturedStmtClass:
|
||||
for (Stmt *SubStmt : S->children()) {
|
||||
if (SubStmt) {
|
||||
M[SubStmt] = S;
|
||||
BuildParentMap(M, SubStmt, OVMode);
|
||||
}
|
||||
}
|
||||
if (Stmt *SubStmt = cast<CapturedStmt>(S)->getCapturedStmt()) {
|
||||
M[SubStmt] = S;
|
||||
BuildParentMap(M, SubStmt, OVMode);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
for (Stmt *SubStmt : S->children()) {
|
||||
if (SubStmt) {
|
||||
|
|
|
@ -4,4 +4,8 @@
|
|||
void openmp_parallel_crash_test() {
|
||||
#pragma omp parallel
|
||||
;
|
||||
#pragma omp parallel for
|
||||
for (int i = 0; i < 8; ++i)
|
||||
for (int j = 0, k = 0; j < 8; ++j)
|
||||
;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue