summaryrefslogtreecommitdiff
path: root/flang-rt
diff options
context:
space:
mode:
authorPeter Klausler <pklausler@nvidia.com>2025-08-29 07:49:54 -0700
committerGitHub <noreply@github.com>2025-08-29 07:49:54 -0700
commit9005ae5d89b6d4430ea5eb25d37cb4089d8267b8 (patch)
tree5d2afeeed3005ea80987fb06d492f082a1557218 /flang-rt
parentb1e109064cf53621408662b2cebfbd70bbcd501b (diff)
[flang][runtime] Handle null list-directed fields in child input (#155707)
List-directed input statements maintain two flags ("eatComma_" and "hitSlash_") in their state that allow GetNextDataEdit() to detect and handle field separators (usually ',') and slashes in the input stream. For list-directed input in a defined input subroutine, it's necessary to copy those flags from the parent list-directed input statement (if any) and update them afterwards. Fixes https://github.com/llvm/llvm-project/issues/154791.
Diffstat (limited to 'flang-rt')
-rw-r--r--flang-rt/lib/runtime/descriptor-io.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/flang-rt/lib/runtime/descriptor-io.cpp b/flang-rt/lib/runtime/descriptor-io.cpp
index a60d0b90da46..668190febf39 100644
--- a/flang-rt/lib/runtime/descriptor-io.cpp
+++ b/flang-rt/lib/runtime/descriptor-io.cpp
@@ -170,6 +170,8 @@ static RT_API_ATTRS Fortran::common::optional<bool> DefinedFormattedIo(
io.GotChar(io.InquirePos() - *startPos);
}
return handler.GetIoStat() == IostatOk;
+ } else if (peek && peek->descriptor == DataEdit::ListDirectedNullValue) {
+ return false;
} else {
// There's a defined I/O subroutine, but there's a FORMAT present and
// it does not have a DT data edit descriptor, so apply default formatting