-
Notifications
You must be signed in to change notification settings - Fork 14.7k
[flang][runtime] Handle empty NAMELIST value list #151770
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unit test?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How does checking if the handler has signalled an error correspond to the empty list? It isn't obvious where there error is coming from, though I assume if I stared at the code long enough I would be able to figure it out.
The original code was assuming that there must have been an error if no items had been read. But sometimes there are just no items in the input to be read, and this is not an error. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
InputNamelist() returns early if any value list read in by InputDerivedType() or DescriptorIo<Input>() is empty, since they return false. But an empty value list is okay, and the early return should occur only on error. Fixes llvm#151756.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
Thanks!
InputNamelist() returns early if any value list read in by InputDerivedType() or DescriptorIo() is empty, since they return false. But an empty value list is okay, and the early return should occur only on error.
Fixes #151756.