[flang-commits] [PATCH] D127422: [flang][runtime] Fix list-directed/NAMELIST complex input with "r*" repetition count

Peter Klausler via Phabricator via flang-commits flang-commits at lists.llvm.org
Thu Jun 9 12:07:11 PDT 2022


klausler created this revision.
klausler added a project: Flang.
Herald added a subscriber: jdoerfert.
Herald added a project: All.
klausler requested review of this revision.

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.


https://reviews.llvm.org/D127422

Files:
  flang/runtime/io-stmt.cpp


Index: flang/runtime/io-stmt.cpp
===================================================================
--- flang/runtime/io-stmt.cpp
+++ flang/runtime/io-stmt.cpp
@@ -796,7 +796,9 @@
     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_) {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D127422.435631.patch
Type: text/x-patch
Size: 434 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/flang-commits/attachments/20220609/43f821a5/attachment-0001.bin>


More information about the flang-commits mailing list