resolve.c (gfc_verify_binding_labels): Check for NULL pointer.
authorSteven G. Kargl <kargl@gcc.gnu.org>
Tue, 20 Oct 2015 00:31:48 +0000 (00:31 +0000)
committerSteven G. Kargl <kargl@gcc.gnu.org>
Tue, 20 Oct 2015 00:31:48 +0000 (00:31 +0000)
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.

From-SVN: r229013

gcc/fortran/ChangeLog
gcc/fortran/resolve.c
gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/pr67900.f90 [new file with mode: 0644]

index 0b94ad70658656fb127ca173a9e2d9124a5bdedf..44c60faa2b45ec4368da6a93333782a310a7c877 100644 (file)
@@ -1,3 +1,7 @@
+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>
 
        PR fortran/68019
index 491507b0cee72f19d5d647a16f234de14ecce761..8798d4d9e96049faa89573b55e52e5314fafadb6 100644 (file)
@@ -10800,7 +10800,7 @@ gfc_verify_binding_labels (gfc_symbol *sym)
       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 5a32885249a335b37ea86b41e4c621a9fd032ea8..51fb89574d788e86b6ad90243a72e55ff2e7a453 100644 (file)
@@ -1,3 +1,7 @@
+2015-10-19  Steven G. Kargl  <kargl@gcc.gnu.org>
+
+       * gfortran.dg/pr67900.f90: New tests.
+
 2015-10-19  Pierre-Marie de Rodat  <derodat@adacore.com>
 
        * gnat.dg/opt50.adb: New test.
diff --git a/gcc/testsuite/gfortran.dg/pr67900.f90 b/gcc/testsuite/gfortran.dg/pr67900.f90
new file mode 100644 (file)
index 0000000..c077fbc
--- /dev/null
@@ -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