[all-commits] [llvm/llvm-project] 047168: [flang] Fix parser crash (#105875)

Peter Klausler via All-commits all-commits at lists.llvm.org
Mon Aug 26 10:54:25 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 047168dae79cd6e0087eb86810006c635f017df6
      https://github.com/llvm/llvm-project/commit/047168dae79cd6e0087eb86810006c635f017df6
  Author: Peter Klausler <35819229+klausler at users.noreply.github.com>
  Date:   2024-08-26 (Mon, 26 Aug 2024)

  Changed paths:
    M flang/lib/Parser/io-parsers.cpp
    A flang/test/Parser/recovery05.f90

  Log Message:
  -----------
  [flang] Fix parser crash (#105875)

The production for a bare file unit number in an I/O statement checks
that the scalar integer expression isn't followed by "=", in order to
disambiguate FLUSHN from FLUSHN=1, and to not treat a control specifier
keyword as an integer expression. The implementation of this check used
!"="_tok, which has the side effect of producing no error message; this
can lead to a parsing crash later when a failed parse of an erroneous
program is found to have produced no errors. Rewrite as a lookAhead call
for those characters that acually can follow a bare unit number.

Fixes https://github.com/llvm/llvm-project/issues/105779.



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