Skip to content

Conversation

@klausler
Copy link
Contributor

The various per-type functions for list-directed (including namelist) input editing all call a common function to detect whether the next token of input is the name of a namelist item. This check simply determines whether this next token looks like an identifier followed by '=', '(', or '%', and this fails when the next item of input is a NAN with parenthesized stuff afterwards. Make the check smarter so that it ensures that any upcoming possible identifier is actually the name of an item in the namelist group. (And that's tricky too when the group has an array item named "nan" and the upcoming input is "nan("; see the newly-added unit test case.)

Fixes #152538.

more

Copy link
Contributor

@DanielCChen DanielCChen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.
The full tests are also fixed.
Thanks.

The various per-type functions for list-directed (including namelist)
input editing all call a common function to detect whether the
next token of input is the name of a namelist item.  This check
simply determines whether this next token looks like an identifier
followed by '=', '(', or '%', and this fails when the next item of
input is a NAN with parenthesized stuff afterwards.  Make the check
smarter so that it ensures that any upcoming possible identifier is
actually the name of an item in the namelist group.  (And that's
tricky too when the group has an array item named "nan" and the
upcoming input is "nan("; see the newly-added unit test case.)

Fixes llvm#152538.

more
@klausler klausler merged commit 925db84 into llvm:main Aug 13, 2025
9 checks passed
@klausler klausler deleted the bug152538 branch August 13, 2025 21:37
searlmc1 pushed a commit to ROCm/llvm-project that referenced this pull request Sep 7, 2025
…)"

 breaks 535.weather at runtime

This reverts commit 925db84.
searlmc1 pushed a commit to ROCm/llvm-project that referenced this pull request Sep 7, 2025
searlmc1 pushed a commit to ROCm/llvm-project that referenced this pull request Oct 4, 2025
The various per-type functions for list-directed (including namelist)
input editing all call a common function to detect whether the next
token of input is the name of a namelist item. This check simply
determines whether this next token looks like an identifier followed by
'=', '(', or '%', and this fails when the next item of input is a NAN
with parenthesized stuff afterwards. Make the check smarter so that it
ensures that any upcoming possible identifier is actually the name of an
item in the namelist group. (And that's tricky too when the group has an
array item named "nan" and the upcoming input is "nan("; see the
newly-added unit test case.)

Fixes llvm#152538.

more
searlmc1 pushed a commit to ROCm/llvm-project that referenced this pull request Oct 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[flang] NML: Failed to read namelist that contains IEEE specification exception.

4 participants