[flang-commits] [flang] 1444bc8 - [flang][runtime] Fix list-directed/NAMELIST complex input with "r*" repetition count
Peter Klausler via flang-commits
flang-commits at lists.llvm.org
Mon Jun 13 10:50:36 PDT 2022
Author: Peter Klausler
Date: 2022-06-13T10:50:25-07:00
New Revision: 1444bc824136ddcf2a59153658fb7d19a5bc33ef
URL: https://github.com/llvm/llvm-project/commit/1444bc824136ddcf2a59153658fb7d19a5bc33ef
DIFF: https://github.com/llvm/llvm-project/commit/1444bc824136ddcf2a59153658fb7d19a5bc33ef.diff
LOG: [flang][runtime] Fix list-directed/NAMELIST complex input with "r*" repetition count
The little state machine in GetNextDataEdit() wasn't transitioning
properly from reading the imaginary part of the number back to the
real part for the next iteration of a repeated value.
Differential Revision: https://reviews.llvm.org/D127422
Added:
Modified:
flang/runtime/io-stmt.cpp
Removed:
################################################################################
diff --git a/flang/runtime/io-stmt.cpp b/flang/runtime/io-stmt.cpp
index a73012dab616..0201ad2bf7da 100644
--- a/flang/runtime/io-stmt.cpp
+++ b/flang/runtime/io-stmt.cpp
@@ -799,7 +799,9 @@ ListDirectedStatementState<Direction::Input>::GetNextDataEdit(
if (remaining_ > 0) {
repeatPosition_.emplace(io);
}
- return edit;
+ if (!imaginaryPart_) {
+ return edit;
+ }
}
// Skip separators, handle a "r*c" repeat count; see 13.10.2 in Fortran 2018
if (imaginaryPart_) {
More information about the flang-commits
mailing list