Skip to content

Commit 1b77775

Browse files
authored
[flang][runtime] Block bad left tabbing in child I/O (#158758)
Child I/O subroutines are not supposed to use T or TL control edit descriptors in formats to move the position in the current record to a point before where it stood at the time of their calls (F'2023 12.6.4.8.3 paragraph 18), but we should also guard against attempts to do so, using the same means used to prevent such attempts in non-advancing I/O. Fixes llvm/llvm-project#158723.
1 parent deb2861 commit 1b77775

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

flang-rt/lib/runtime/unit.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -827,6 +827,7 @@ ChildIo &ExternalFileUnit::PushChildIo(IoStatementState &parent) {
827827
Terminator &terminator{parent.GetIoErrorHandler()};
828828
OwningPtr<ChildIo> next{New<ChildIo>{terminator}(parent, std::move(current))};
829829
child_.reset(next.release());
830+
leftTabLimit = positionInRecord;
830831
return *child_;
831832
}
832833

0 commit comments

Comments
 (0)