[all-commits] [llvm/llvm-project] 975579: [flang] Fix variable unformatted I/O bug with outp...

Peter Klausler via All-commits all-commits at lists.llvm.org
Thu May 23 15:32:36 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 975579bd94d4b130cf6363375d9e723281cb0ce5
      https://github.com/llvm/llvm-project/commit/975579bd94d4b130cf6363375d9e723281cb0ce5
  Author: Peter Klausler <35819229+klausler at users.noreply.github.com>
  Date:   2024-05-23 (Thu, 23 May 2024)

  Changed paths:
    M flang/runtime/external-unit.cpp
    M flang/runtime/unit.cpp

  Log Message:
  -----------
  [flang] Fix variable unformatted I/O bug with output after input (#92828)

When reading variable-length unformatted records, the external I/O
library frames the input buffer so that the footer of the previous
record remains in frame. This is done so that a BACKSPACE doesn't have
to do an extra read to get the length of the previous record before
repositioning over it.

When switching from input to output to overwrite or append new records
after reading any, it is necessary to undo this framing of the last word
in the previous record, since the new output isn't going to define it in
the buffer and it'll be overwritten in the filesystem with garbage.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list