Skip to content

Commit 0dd2ed4

Browse files
authored
[flang][OpenACC] Fix crash due to truncated scope source range (#136206)
A combined construct needs to ensure that the source range of their initial statement is part of the source range of their scope. Fixes #136076.
1 parent aac53ad commit 0dd2ed4

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

flang/lib/Semantics/resolve-names.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1384,6 +1384,20 @@ class AccVisitor : public virtual DeclarationVisitor {
13841384
void Post(const parser::AccEndBlockDirective &) {
13851385
messageHandler().set_currStmtSource(std::nullopt);
13861386
}
1387+
bool Pre(const parser::AccBeginCombinedDirective &x) {
1388+
AddAccSourceRange(x.source);
1389+
return true;
1390+
}
1391+
void Post(const parser::AccBeginCombinedDirective &) {
1392+
messageHandler().set_currStmtSource(std::nullopt);
1393+
}
1394+
bool Pre(const parser::AccEndCombinedDirective &x) {
1395+
AddAccSourceRange(x.source);
1396+
return true;
1397+
}
1398+
void Post(const parser::AccEndCombinedDirective &) {
1399+
messageHandler().set_currStmtSource(std::nullopt);
1400+
}
13871401
bool Pre(const parser::AccBeginLoopDirective &x) {
13881402
AddAccSourceRange(x.source);
13891403
return true;

0 commit comments

Comments
 (0)