Skip to content

Commit 3726626

Browse files
committed
[flang] Fix crash from USE-associated defined I/O subprograms
User-defined derived type I/O implementation subroutines and generic interfaces may be USE-associated, but the code that builds the type description table wasn't allowing for that possibility. Add a call to GetUltimate() to cope. Differential Revision: https://reviews.llvm.org/D117902
1 parent db07e08 commit 3726626

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

flang/lib/Semantics/runtime-type-info.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1065,7 +1065,7 @@ void RuntimeTableBuilder::IncorporateDefinedIoGenericInterfaces(
10651065
GenericKind::DefinedIo definedIo, const Scope *scope) {
10661066
for (; !scope->IsGlobal(); scope = &scope->parent()) {
10671067
if (auto asst{scope->find(name)}; asst != scope->end()) {
1068-
const Symbol &generic{*asst->second};
1068+
const Symbol &generic{asst->second->GetUltimate()};
10691069
const auto &genericDetails{generic.get<GenericDetails>()};
10701070
CHECK(std::holds_alternative<GenericKind::DefinedIo>(
10711071
genericDetails.kind().u));

0 commit comments

Comments
 (0)