This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH,committed] PR fortran/67900 -- Check for NULL pointer
- From: Steve Kargl <sgk at troutmask dot apl dot washington dot edu>
- To: fortran at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org
- Date: Mon, 19 Oct 2015 17:33:29 -0700
- Subject: [PATCH,committed] PR fortran/67900 -- Check for NULL pointer
- Authentication-results: sourceware.org; auth=none
Committed as 'obvious' after Mikael's comment in PR audit trail.
2015-10-19 Steven G. Kargl <kargl@gcc.gnu.org>
* resolve.c (gfc_verify_binding_labels): Check for NULL pointer.
2015-10-19 Steven G. Kargl <kargl@gcc.gnu.org>
* gfortran.dg/pr67900.f90: New tests.
--
Steve
Index: gcc/fortran/resolve.c
===================================================================
--- gcc/fortran/resolve.c (revision 229002)
+++ gcc/fortran/resolve.c (working copy)
@@ -10800,7 +10800,7 @@ gfc_verify_binding_labels (gfc_symbol *s
sym->binding_label = NULL;
}
- else if (sym->attr.flavor == FL_VARIABLE
+ else if (sym->attr.flavor == FL_VARIABLE && module
&& (strcmp (module, gsym->mod_name) != 0
|| strcmp (sym->name, gsym->sym_name) != 0))
{
Index: gcc/testsuite/gfortran.dg/pr67900.f90
===================================================================
--- gcc/testsuite/gfortran.dg/pr67900.f90 (revision 0)
+++ gcc/testsuite/gfortran.dg/pr67900.f90 (working copy)
@@ -0,0 +1,19 @@
+! { dg-do compile }
+! PR fortran/67900
+! Original code contributed by Giorgian Borca-Tasciuc
+! giorgianb at gmail dot com
+!
+program main
+ implicit none
+ interface f
+ function f_real(x)
+ real, bind(c) :: x
+ real :: f_real
+ end function f_real
+
+ function f_integer(x)
+ integer, bind(c) :: x
+ integer :: f_integer
+ end function f_integer
+ end interface f
+end program main