This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH, PR69043, fortran] Trying to include a directory causes an infinite loop


GFortran's scanner appears to go into an infinite loop if you try to pass a directory to 'include'. This patch will check for a directory using stat() after fopen() has verified its existence.

I'm assuming stat() will be OK to call here since add_path_to_list uses it. I've only been able to check it on a Linux system so far.

Botstrapped and tested for regressions on x86_64-pc-linux-gnu. There is a test case for the bug included.

My office is about to close for the Christmas holiday, so I apologise if I don't respond to questions promptly.

2015-12-24  Jim MacArthur <jim.macarthur@codethink.co.uk>

	PR fortran/69043
        * scanner.c (load_file): Abort and show	an error if stat() shows
        the path is a directory.

Attachment: include-directory-patch-svn
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]