[flang] Allow user to recover from bad edit descriptor with INTEGER

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.

Differential Revision: https://reviews.llvm.org/D122749
This commit is contained in:
Jean Perier 2022-03-31 10:57:01 +02:00
parent 14c7754a35
commit 88d4b85f59
1 changed files with 1 additions and 1 deletions

View File

@ -57,7 +57,7 @@ bool EditIntegerOutput(IoStatementState &io, const DataEdit &edit,
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;