Commit 3726626a authored by Peter Klausler's avatar Peter Klausler
Browse files

[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
parent db07e082
......@@ -1065,7 +1065,7 @@ void RuntimeTableBuilder::IncorporateDefinedIoGenericInterfaces(
GenericKind::DefinedIo definedIo, const Scope *scope) {
for (; !scope->IsGlobal(); scope = &scope->parent()) {
if (auto asst{scope->find(name)}; asst != scope->end()) {
const Symbol &generic{*asst->second};
const Symbol &generic{asst->second->GetUltimate()};
const auto &genericDetails{generic.get<GenericDetails>()};
CHECK(std::holds_alternative<GenericKind::DefinedIo>(
genericDetails.kind().u));
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment