[flang-commits] [PATCH] D127797: [flang][runtime] Better error message for mis-ASSIGN'ed FORMAT statement

Peter Klausler via Phabricator via flang-commits flang-commits at lists.llvm.org
Wed Jun 15 14:46:35 PDT 2022


This revision was automatically updated to reflect the committed changes.
Closed by commit rG690de85ed8e9: [flang][runtime] Better error message for mis-ASSIGN'ed FORMAT (authored by klausler).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D127797/new/

https://reviews.llvm.org/D127797

Files:
  flang/runtime/format.h


Index: flang/runtime/format.h
===================================================================
--- flang/runtime/format.h
+++ flang/runtime/format.h
@@ -124,8 +124,13 @@
   CharType GetNextChar(IoErrorHandler &handler) {
     SkipBlanks();
     if (offset_ >= formatLength_) {
-      handler.SignalError(
-          IostatErrorInFormat, "FORMAT missing at least one ')'");
+      if (formatLength_ == 0) {
+        handler.SignalError(
+            IostatErrorInFormat, "Empty or badly assigned FORMAT");
+      } else {
+        handler.SignalError(
+            IostatErrorInFormat, "FORMAT missing at least one ')'");
+      }
       return '\n';
     }
     return format_[offset_++];


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D127797.437350.patch
Type: text/x-patch
Size: 692 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/flang-commits/attachments/20220615/ca45d528/attachment.bin>


More information about the flang-commits mailing list