From 56ac14f870e6873eb4621d28ea96726e782d1a7b Mon Sep 17 00:00:00 2001 From: Peter Klausler Date: Wed, 2 Apr 2025 16:37:45 -0700 Subject: [PATCH] [flang][runtime] Remove bad runtime assertion The RUNTIME_CHECK in question doesn't allow for the possibility that an allocatable or pointer component could be processed by defined I/O. Remove it in favor of a dynamic allocation check. --- flang-rt/lib/runtime/descriptor-io.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) 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");