summaryrefslogtreecommitdiff
path: root/flang-rt
diff options
context:
space:
mode:
authorPeter Klausler <pklausler@nvidia.com>2025-09-17 09:16:30 -0700
committerGitHub <noreply@github.com>2025-09-17 09:16:30 -0700
commit1b777752ef1b4532710ffe443466c743b9d54e98 (patch)
treee36843722a468e589204f3f2d24e6ef63c13c8e6 /flang-rt
parentdeb2861b07e503b729b854edbffdeae7cd4a1aa6 (diff)
[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 https://github.com/llvm/llvm-project/issues/158723.
Diffstat (limited to 'flang-rt')
-rw-r--r--flang-rt/lib/runtime/unit.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/flang-rt/lib/runtime/unit.cpp b/flang-rt/lib/runtime/unit.cpp
index da3783417f23..549fbeaca05b 100644
--- a/flang-rt/lib/runtime/unit.cpp
+++ b/flang-rt/lib/runtime/unit.cpp
@@ -827,6 +827,7 @@ ChildIo &ExternalFileUnit::PushChildIo(IoStatementState &parent) {
Terminator &terminator{parent.GetIoErrorHandler()};
OwningPtr<ChildIo> next{New<ChildIo>{terminator}(parent, std::move(current))};
child_.reset(next.release());
+ leftTabLimit = positionInRecord;
return *child_;
}