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]

[gfotran, committed] Fix segfault in PR 17535 (not the bug itself)


This patch doesn't fix the bug in PR 17535, it only fixes the segfault by
setting the 'where' field of an interface that is being read from a module to
the place where the module is used. This locus might be needed if the user
writes something like
  use m, a=>x, b=>x
where the members of the generic interfaces a and b conflict, but I haven't
checked this, as generic interfaces are currently very much broken since the
fix for private entities. Other than that, this locus will only play a role
when the compiler gets something wrong, and has to print the loci of the
interfaces, as in the real problem behind 17535.

Built and tested with not regressions, committed under the obviously correct rule.

- Tobi

Index: ChangeLog
===================================================================
RCS file: /cvs/gcc/gcc/gcc/fortran/ChangeLog,v
retrieving revision 1.235
diff -u -p -r1.235 ChangeLog
--- ChangeLog   8 Oct 2004 22:03:35 -0000       1.235
+++ ChangeLog   9 Oct 2004 15:58:55 -0000
@@ -1,3 +1,8 @@
+2004-10-09  Tobias Schlueter  <tobias.schlueter@physik.uni-muenchen.de>
+
+       * module.c (mio_interface_rest): Set where member of interface
+       while loading.
+
 2004-10-08  Andrew Pinski  <pinskia@physics.uc.edu>

        PR fortran/17901
Index: module.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/fortran/module.c,v
retrieving revision 1.17
diff -u -p -r1.17 module.c
--- module.c    16 Sep 2004 16:00:42 -0000      1.17
+++ module.c    9 Oct 2004 15:58:56 -0000
@@ -2570,6 +2570,7 @@ mio_interface_rest (gfc_interface ** ip)
            break;

          p = gfc_get_interface ();
+         p->where = gfc_current_locus;
          mio_symbol_ref (&p->sym);

          if (tail == NULL)


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