[flang-commits] [PATCH] D122749: [flang] Allow user to recover from bad edit descriptor with INTEGER

Jean Perier via Phabricator via flang-commits flang-commits at lists.llvm.org
Wed Mar 30 10:23:31 PDT 2022


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

Runtime was crashing when an INTEGER passed in formatted output with
a bad edit descriptor even when the user did provide IOSTAT. Flang
is already signaling an error when facing similar error with other
types. Do the same with INTEGERs.

The input case is already signaling an error in the related input error
case.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D122749

Files:
  flang/runtime/edit-output.cpp


Index: flang/runtime/edit-output.cpp
===================================================================
--- flang/runtime/edit-output.cpp
+++ flang/runtime/edit-output.cpp
@@ -57,7 +57,7 @@
     return EditCharacterOutput(
         io, edit, reinterpret_cast<char *>(&n), sizeof n);
   default:
-    io.GetIoErrorHandler().Crash(
+    io.GetIoErrorHandler().SignalError(IostatErrorInFormat,
         "Data edit descriptor '%c' may not be used with an INTEGER data item",
         edit.descriptor);
     return false;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D122749.419210.patch
Type: text/x-patch
Size: 518 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/flang-commits/attachments/20220330/1d439f65/attachment.bin>


More information about the flang-commits mailing list