diff --git a/flang-rt/lib/runtime/descriptor-io.h b/flang-rt/lib/runtime/descriptor-io.h index dd399164325cb..eb60f106c9203 100644 --- a/flang-rt/lib/runtime/descriptor-io.h +++ b/flang-rt/lib/runtime/descriptor-io.h @@ -263,10 +263,8 @@ static RT_API_ATTRS bool DefaultComponentIO(IoStatementState &io, // Component is itself a descriptor char *pointer{ origDescriptor.Element(origSubscripts) + component.offset()}; - RUNTIME_CHECK( - terminator, component.genre() == typeInfo::Component::Genre::Automatic); const Descriptor &compDesc{*reinterpret_cast(pointer)}; - return DescriptorIO(io, compDesc, table); + return compDesc.IsAllocated() && DescriptorIO(io, compDesc, table); } #else terminator.Crash("not yet implemented: component IO");