[flang-commits] [PATCH] D117595: [flang] runtime error on inappropriate OPEN(UNIT=extant, RECL=n)

Peter Klausler via Phabricator via flang-commits flang-commits at lists.llvm.org
Tue Jan 18 14:54:38 PST 2022


This revision was automatically updated to reflect the committed changes.
Closed by commit rGe847b30369ad: [flang] runtime error on inappropriate OPEN(UNIT=extant,RECL=n) (authored by klausler).
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D117595

Files:
  flang/runtime/io-api.cpp


Index: flang/runtime/io-api.cpp
===================================================================
--- flang/runtime/io-api.cpp
+++ flang/runtime/io-api.cpp
@@ -826,13 +826,15 @@
   }
   if (n <= 0) {
     io.GetIoErrorHandler().SignalError("RECL= must be greater than zero");
-  }
-  if (open->wasExtant() &&
-      open->unit().openRecl.value_or(n) != static_cast<std::int64_t>(n)) {
+    return false;
+  } else if (open->wasExtant() &&
+      open->unit().openRecl.value_or(0) != static_cast<std::int64_t>(n)) {
     open->SignalError("RECL= may not be changed for an open unit");
+    return false;
+  } else {
+    open->unit().openRecl = n;
+    return true;
   }
-  open->unit().openRecl = n;
-  return true;
 }
 
 bool IONAME(SetStatus)(Cookie cookie, const char *keyword, std::size_t length) {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D117595.401003.patch
Type: text/x-patch
Size: 805 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/flang-commits/attachments/20220118/b5bcc9fb/attachment-0001.bin>


More information about the flang-commits mailing list