http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49623

           Summary: Segfault of "gfortran -L" if no argument follows the
                    "-L"
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Keywords: ice-on-invalid-code
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassig...@gcc.gnu.org
        ReportedBy: bur...@gcc.gnu.org


While it works for the C driver:

$ gcc foo.c -L
gcc: error: missing argument to ā€˜-Lā€™

the Fortran driver segfaults when there is no argument following the "-L"
argument:

$ gfortran foo.f90 -L
Segmentation fault


Valgrind shows:

==18481== Invalid read of size 1
==18481==    at 0x4A06D82: strlen (mc_replace_strmem.c:275)
==18481==    by 0x40E8BE: lang_specific_driver (gfortranspec.c:95)
==18481==    by 0x405EBF: process_command (gcc.c:3637)
==18481==    by 0x40B455: main (gcc.c:6263)
==18481==  Address 0x0 is not stack'd, malloc'd or (recently) free'd

Reply via email to