This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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]

[gfortran, committed] Fix segfault in PR16336


This patch which I commit under the obviously correct rule, fixes a bug
with error reporting: gfc_match_common used to call gfc_error with '%s'
in the format string, but no argument to go with that format item. D'oh.
I verified that the error message is now emitted correctly, and also
looked through match.c to find other omissions of the same type.

I'm inclined to believe that the code in PR 16336 is indeed invalid, but
I will double check the standard to make sure that this is true.

Built and tested on i686-pc-linux.

- Tobi

Index: ChangeLog
===================================================================
RCS file: /cvs/gcc/gcc/gcc/fortran/ChangeLog,v
retrieving revision 1.109
diff -u -p -r1.109 ChangeLog
--- ChangeLog   10 Jul 2004 12:45:33 -0000      1.109
+++ ChangeLog   10 Jul 2004 16:19:00 -0000
@@ -3,6 +3,9 @@
        * expr.c (gfc_check_pointer_assign): Verify that rank of the LHS
        and RHS match. Return early if the RHS is NULL().

+       PR fortran/16336
+       * match.c (match_common): Fix error reporting for used common.
+
 2004-07-10  Tobias Schlueter  <tobias.schlueter@physik.uni-muenchen.de>

        * trans-common.c: Fix whitespace issues, make variable names
Index: match.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/fortran/match.c,v
retrieving revision 1.15
diff -u -p -r1.15 match.c
--- match.c     1 Jul 2004 07:50:18 -0000       1.15
+++ match.c     10 Jul 2004 16:19:00 -0000
@@ -2146,7 +2146,7 @@ gfc_match_common (void)
          if (t->use_assoc)
            {
              gfc_error ("COMMON block '%s' at %C has already "
-                        "been USE-associated");
+                        "been USE-associated", name);
              goto cleanup;
            }
        }


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