diff options
author | Peter Klausler <pklausler@nvidia.com> | 2022-01-18 15:17:15 -0800 |
---|---|---|
committer | Peter Klausler <pklausler@nvidia.com> | 2022-01-21 17:49:09 -0800 |
commit | 3726626a26ec7bfccfd526e02f89c1ac5fe3520a (patch) | |
tree | ab2bce343819e408b9289319e407a1e5fb28e026 | |
parent | db07e082abafb1494ba674047645e6113316673c (diff) |
[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
-rw-r--r-- | flang/lib/Semantics/runtime-type-info.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/flang/lib/Semantics/runtime-type-info.cpp b/flang/lib/Semantics/runtime-type-info.cpp index 4c53df09ee63..250223bfafab 100644 --- a/flang/lib/Semantics/runtime-type-info.cpp +++ b/flang/lib/Semantics/runtime-type-info.cpp @@ -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)); |