Skip to content

Commit f2de356

Browse files
committed
Ensure not to return a bad child range if the clause has no expr
1 parent 6c87483 commit f2de356

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

clang/lib/AST/OpenMPClause.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,8 +305,14 @@ OMPClause::child_range OMPIfClause::used_children() {
305305
return child_range(&Condition, &Condition + 1);
306306
}
307307

308-
OMPClause::child_range OMPNowaitClause::used_children() {
308+
/*OMPClause::child_range OMPNowaitClause::used_children() {
309309
return child_range(&Condition, &Condition + 1);
310+
}*/
311+
OMPClause::child_range OMPNowaitClause::used_children() {
312+
if (Condition)
313+
return child_range(&Condition, &Condition + 1);
314+
Stmt *Null = nullptr;
315+
return child_range(&Null, &Null);
310316
}
311317

312318
OMPClause::child_range OMPGrainsizeClause::used_children() {

0 commit comments

Comments
 (0)