Skip to content

Commit 7b50176

Browse files
authored
[flang][runtime] Flush output before INQUIRE(..., SIZE=) (#75379)
Ensure that any buffered data has tranferred to an external unit before measuring its file size.
1 parent 1794b61 commit 7b50176

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

flang/runtime/io-stmt.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1219,6 +1219,7 @@ bool InquireUnitState::Inquire(
12191219
case HashInquiryKeyword("SIZE"):
12201220
result = -1;
12211221
if (unit().IsConnected()) {
1222+
unit().FlushOutput(*this);
12221223
if (auto size{unit().knownSize()}) {
12231224
result = *size;
12241225
}

0 commit comments

Comments
 (0)