diff --git a/flang-rt/lib/runtime/namelist.cpp b/flang-rt/lib/runtime/namelist.cpp index 2325ca18ba7aa..828215e885e97 100644 --- a/flang-rt/lib/runtime/namelist.cpp +++ b/flang-rt/lib/runtime/namelist.cpp @@ -570,12 +570,14 @@ bool IODEF(InputNamelist)(Cookie cookie, const NamelistGroup &group) { addendum && addendum->derivedType()) { const NonTbpDefinedIoTable *table{group.nonTbpDefinedIo}; listInput->ResetForNextNamelistItem(/*inNamelistSequence=*/true); - if (!IONAME(InputDerivedType)(cookie, *useDescriptor, table)) { + if (!IONAME(InputDerivedType)(cookie, *useDescriptor, table) && + handler.InError()) { return false; } } else { listInput->ResetForNextNamelistItem(useDescriptor->rank() > 0); - if (!descr::DescriptorIO(io, *useDescriptor)) { + if (!descr::DescriptorIO(io, *useDescriptor) && + handler.InError()) { return false; } }