Peter Klausler 047168dae7
[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.
2024-08-26 10:54:03 -07:00
..