From 5034e1730f7a4dbd8004900096c4b176d24f13cb Mon Sep 17 00:00:00 2001 From: Peter Klausler Date: Mon, 6 Dec 2021 07:42:13 -0800 Subject: [PATCH] [flang] Remove runtime check from OpenFile::Close() In error cases it is possible to CLOSE a unit that has not been successfully connected, so don't crash when the file descriptor is negative. Differential Revision: https://reviews.llvm.org/D115165 --- flang/runtime/file.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/flang/runtime/file.cpp b/flang/runtime/file.cpp index 00263fb..4e36978 100644 --- a/flang/runtime/file.cpp +++ b/flang/runtime/file.cpp @@ -157,7 +157,6 @@ void OpenFile::Predefine(int fd) { } void OpenFile::Close(CloseStatus status, IoErrorHandler &handler) { - CheckOpen(handler); pending_.reset(); knownSize_.reset(); switch (status) { -- 2.7.4