Skip to content

Commit f462bf5

Browse files
Guard against null cb
1 parent 86cb8b6 commit f462bf5

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

flang/lib/Semantics/resolve-directives.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1707,9 +1707,10 @@ Symbol *AccAttributeVisitor::ResolveAccCommonBlockName(
17071707
// Look for COMMON block in the modules
17081708
for (const Scope &childScope : context_.globalScope().children()) {
17091709
if (childScope.kind() == Scope::Kind::Module) {
1710-
auto *cb{childScope.FindCommonBlock(name->source)};
1711-
name->symbol = cb;
1712-
return cb;
1710+
if (auto *cb{childScope.FindCommonBlock(name->source)}) {
1711+
name->symbol = cb;
1712+
return cb;
1713+
}
17131714
}
17141715
}
17151716
return nullptr;

0 commit comments

Comments
 (0)