Skip to content

Commit a5f5d72

Browse files
committed
[flang][runtime] When NAMELIST input hits EOF, signal END, not an error
NAMELIST input processing in the runtime support library treats an end-of-file found while searching for the initial '&' character as an error condition, but it really should be distinguishable. Call SignalEnd() rather than SignalError(). Differential Revision: https://reviews.llvm.org/D135212
1 parent c11b445 commit a5f5d72

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

flang/runtime/namelist.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,11 @@ bool IONAME(InputNamelist)(Cookie cookie, const NamelistGroup &group) {
383383
next = io.GetNextNonBlank(byteCount);
384384
}
385385
}
386-
if (!next || *next != '&') {
386+
if (!next) {
387+
handler.SignalEnd();
388+
return false;
389+
}
390+
if (*next != '&') {
387391
handler.SignalError(
388392
"NAMELIST input group does not begin with '&' (at '%lc')", *next);
389393
return false;

0 commit comments

Comments
 (0)