[flang-commits] [PATCH] D127017: [flang][runtime] Signal format error when input field width is zero
Peter Klausler via Phabricator via flang-commits
flang-commits at lists.llvm.org
Fri Jun 3 18:14:29 PDT 2022
This revision was automatically updated to reflect the committed changes.
Closed by commit rGaa77cf90aab8: [flang][runtime] Signal format error when input field width is zero (authored by klausler).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D127017/new/
https://reviews.llvm.org/D127017
Files:
flang/runtime/format-implementation.h
Index: flang/runtime/format-implementation.h
===================================================================
--- flang/runtime/format-implementation.h
+++ flang/runtime/format-implementation.h
@@ -434,6 +434,11 @@
} else if (edit.descriptor != DataEdit::DefinedDerivedType) {
edit.width = GetIntField(context);
}
+ if constexpr (std::is_base_of_v<InputStatementState, CONTEXT>) {
+ if (edit.width.value_or(-1) == 0) {
+ ReportBadFormat(context, "Input field width is zero", start);
+ }
+ }
if (edit.descriptor != DataEdit::DefinedDerivedType && PeekNext() == '.') {
++offset_;
edit.digits = GetIntField(context);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D127017.434229.patch
Type: text/x-patch
Size: 654 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/flang-commits/attachments/20220604/ea3c5686/attachment-0001.bin>
More information about the flang-commits
mailing list