This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/87764] gfortran crashes with illegal code
- From: "anlauf at gmx dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 12 Dec 2018 22:02:40 +0000
- Subject: [Bug fortran/87764] gfortran crashes with illegal code
- Auto-submitted: auto-generated
- References: <bug-87764-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87764
Harald Anlauf <anlauf at gmx dot de> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |anlauf at gmx dot de
--- Comment #2 from Harald Anlauf <anlauf at gmx dot de> ---
(In reply to Dominique d'Humieres from comment #1)
> Confirmed from 4.8 up to trunk (9.0). An instrumented compiler gives
>
> f951: Warning: No location in statement
> ../../work/gcc/fortran/trans.c:1768:39: runtime error: member access within
> null pointer of type 'struct gfc_linebuf'
> f951: internal compiler error: Segmentation fault: 11
The warning in comment#0 would be restored by the patch:
Index: gcc/fortran/trans.c
===================================================================
--- gcc/fortran/trans.c (revision 267065)
+++ gcc/fortran/trans.c (working copy)
@@ -1765,8 +1765,11 @@
void
gfc_set_backend_locus (locus * loc)
{
- gfc_current_backend_file = loc->lb->file;
- input_location = loc->lb->location;
+ if (loc->lb)
+ {
+ gfc_current_backend_file = loc->lb->file;
+ input_location = loc->lb->location;
+ }
}
However, this papers over the issue that the locus is not properly set.