Skip to content

Commit ebea5e1

Browse files
committed
Adding one-line exit statement for uninitialized isize variable that affected jf_test_6 with NAG compiler
1 parent c7d327b commit ebea5e1

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/json_module.f90

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4289,6 +4289,10 @@ subroutine get_current_line_from_file(iunit,line)
42894289
if (istat==0) then
42904290
line = line//chunk
42914291
else
4292+
!avoid a comparison to isize if EOF is at the start of object
4293+
![some compilers will leave isize uninitialized for this case]
4294+
if (index(err_message, &
4295+
"Unexpected end of file while parsing start of object") > 0) exit
42924296
if (isize>0 .and. isize<=n_chunk) line = line//chunk(1:isize)
42934297
exit
42944298
end if

0 commit comments

Comments
 (0)