Skip to content

Commit ade9d1f

Browse files
authored
[flang][runtime] Remove bad runtime assertion (#134176)
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.
1 parent 262b3f7 commit ade9d1f

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

flang-rt/lib/runtime/descriptor-io.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -263,10 +263,8 @@ static RT_API_ATTRS bool DefaultComponentIO(IoStatementState &io,
263263
// Component is itself a descriptor
264264
char *pointer{
265265
origDescriptor.Element<char>(origSubscripts) + component.offset()};
266-
RUNTIME_CHECK(
267-
terminator, component.genre() == typeInfo::Component::Genre::Automatic);
268266
const Descriptor &compDesc{*reinterpret_cast<const Descriptor *>(pointer)};
269-
return DescriptorIO<DIR>(io, compDesc, table);
267+
return compDesc.IsAllocated() && DescriptorIO<DIR>(io, compDesc, table);
270268
}
271269
#else
272270
terminator.Crash("not yet implemented: component IO");

0 commit comments

Comments
 (0)